Index · Object → RefCounted → PacketPeer → WebRTCDataChannel

WebRTCDataChannel

Inherited by (1): WebRTCDataChannelExtension

Properties

var write_mode: WebRTCDataChannel.WriteMode = 1

The transfer mode to use when sending outgoing packet. Either text or binary.

Inherited from PacketPeer (1)

Methods

func close() -> void

Closes this data channel, notifying the other peer.

func get_buffered_amount() -> int

Returns the number of bytes currently queued to be sent over this channel.

func get_id() -> int

Returns the ID assigned to this channel during creation (or auto-assigned during negotiation).

If the channel is not negotiated out-of-band the ID will only be available after the connection is established (will return 65535 until then).

func get_label() -> String

Returns the label assigned to this channel during creation.

func get_max_packet_life_time() -> int

Returns the maxPacketLifeTime value assigned to this channel during creation.

Will be 65535 if not specified.

func get_max_retransmits() -> int

Returns the maxRetransmits value assigned to this channel during creation.

Will be 65535 if not specified.

func get_protocol() -> String

Returns the sub-protocol assigned to this channel during creation. An empty string if not specified.

func get_ready_state() -> WebRTCDataChannel.ChannelState

Returns the current state of this channel.

func is_negotiated() -> bool

Returns true if this channel was created with out-of-band configuration.

func is_ordered() -> bool

Returns true if this channel was created with ordering enabled (default).

func poll() -> Error

Reserved, but not used for now.

func was_string_packet() -> bool

Returns true if the last received packet was transferred as text. See write_mode.

Inherited from PacketPeer (6)
func get_packet_error() -> Error
func get_var(allow_objects: bool = false) -> Variant
func put_packet(buffer: PackedByteArray) -> Error
func put_var(var: Variant, full_objects: bool = false) -> Error
Inherited from RefCounted (4)
func init_ref() -> bool
func reference() -> bool
func unreference() -> bool
Inherited from Object (62)
func _get(property: StringName) -> Variant
func _get_property_list() -> Dictionary[]
func _init() -> void
func _iter_get(iter: Variant) -> Variant
func _iter_init(iter: Array) -> bool
func _iter_next(iter: Array) -> bool
func _notification(what: int) -> void
func _set(property: StringName, value: Variant) -> bool
func _to_string() -> String
func _validate_property(property: Dictionary) -> void
func add_user_signal(signal: String, arguments: Array = []) -> void
func call(method: StringName) -> Variant
func callv(method: StringName, arg_array: Array) -> Variant
func cancel_free() -> void
func connect(signal: StringName, callable: Callable, flags: int = 0) -> Error
func disconnect(signal: StringName, callable: Callable) -> void
func emit_signal(signal: StringName) -> Error
func free() -> void
func get(property: StringName) -> Variant
func get_class() -> String
func get_incoming_connections() -> Dictionary[]
func get_indexed(property_path: NodePath) -> Variant
func get_meta(name: StringName, default: Variant = null) -> Variant
func get_meta_list() -> StringName[]
func get_method_list() -> Dictionary[]
func get_property_list() -> Dictionary[]
func get_signal_connection_list(signal: StringName) -> Dictionary[]
func get_signal_list() -> Dictionary[]
func has_meta(name: StringName) -> bool
func has_method(method: StringName) -> bool
func has_signal(signal: StringName) -> bool
func is_class(class: StringName) -> bool
func is_connected(signal: StringName, callable: Callable) -> bool
func notification(what: int, reversed: bool = false) -> void
func remove_meta(name: StringName) -> void
func remove_user_signal(signal: StringName) -> void
func set(property: StringName, value: Variant) -> void
func set_block_signals(enable: bool) -> void
func set_deferred(property: StringName, value: Variant) -> void
func set_indexed(property_path: NodePath, value: Variant) -> void
func set_message_translation(enable: bool) -> void
func set_meta(name: StringName, value: Variant) -> void
func set_script(script: Variant) -> void
func set_translation_domain(domain: StringName) -> void
func to_string() -> String
func tr(message: StringName, context: StringName = &"") -> String
func tr_n(message: StringName, plural_message: StringName, n: int, context: StringName = &"") -> String

Signals

Inherited from Object (2)

Enums & Constants

enum WriteMode
WRITE_MODE_TEXT = 0

Tells the channel to send data over this channel as text. An external peer (non-Godot) would receive this as a string.

WRITE_MODE_BINARY = 1

Tells the channel to send data over this channel as binary. An external peer (non-Godot) would receive this as array buffer or blob.

enum ChannelState
STATE_CONNECTING = 0

The channel was created, but it's still trying to connect.

STATE_OPEN = 1

The channel is currently open, and data can flow over it.

STATE_CLOSING = 2

The channel is being closed, no new messages will be accepted, but those already in queue will be flushed.

STATE_CLOSED = 3

The channel was closed, or connection failed.