Up to date
This page is up to date for Redot 4.3
.
If you still find outdated information, please create an issue.
WebRTCDataChannelΒΆ
Inherits: PacketPeer < RefCounted < Object
Inherited By: WebRTCDataChannelExtension
There is currently no description for this class. Please help us by contributing one!
PropertiesΒΆ
|
MethodsΒΆ
void |
close() |
get_buffered_amount() const |
|
get_id() const |
|
get_label() const |
|
get_max_packet_life_time() const |
|
get_max_retransmits() const |
|
get_protocol() const |
|
get_ready_state() const |
|
is_negotiated() const |
|
is_ordered() const |
|
poll() |
|
was_string_packet() const |
EnumerationsΒΆ
enum WriteMode: π
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.
WriteMode 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: π
ChannelState STATE_CONNECTING = 0
The channel was created, but it's still trying to connect.
ChannelState STATE_OPEN = 1
The channel is currently open, and data can flow over it.
ChannelState STATE_CLOSING = 2
The channel is being closed, no new messages will be accepted, but those already in queue will be flushed.
ChannelState STATE_CLOSED = 3
The channel was closed, or connection failed.
Property DescriptionsΒΆ
The transfer mode to use when sending outgoing packet. Either text or binary.
Method DescriptionsΒΆ
void close() π
Closes this data channel, notifying the other peer.
int get_buffered_amount() const π
Returns the number of bytes currently queued to be sent over this channel.
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).
Returns the label assigned to this channel during creation.
int get_max_packet_life_time() const π
Returns the maxPacketLifeTime
value assigned to this channel during creation.
Will be 65535
if not specified.
int get_max_retransmits() const π
Returns the maxRetransmits
value assigned to this channel during creation.
Will be 65535
if not specified.
String get_protocol() const π
Returns the sub-protocol assigned to this channel during creation. An empty string if not specified.
ChannelState get_ready_state() const π
Returns the current state of this channel, see ChannelState.
bool is_negotiated() const π
Returns true
if this channel was created with out-of-band configuration.
Returns true
if this channel was created with ordering enabled (default).
Reserved, but not used for now.
bool was_string_packet() const π
Returns true
if the last received packet was transferred as text. See write_mode.