2019-05-10 23:46:27 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-07-05 20:07:03 +00:00
<class name= "WebRTCDataChannel" inherits= "PacketPeer" version= "4.2" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../../../doc/class.xsd" >
2019-05-10 23:46:27 +00:00
<brief_description >
</brief_description>
<description >
</description>
<tutorials >
</tutorials>
<methods >
<method name= "close" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2019-05-10 23:46:27 +00:00
<description >
2019-06-03 13:20:15 +00:00
Closes this data channel, notifying the other peer.
2019-05-10 23:46:27 +00:00
</description>
</method>
2021-07-20 16:44:40 +00:00
<method name= "get_buffered_amount" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
2021-07-20 16:44:40 +00:00
<description >
Returns the number of bytes currently queued to be sent over this channel.
</description>
</method>
2019-05-10 23:46:27 +00:00
<method name= "get_id" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
2019-05-10 23:46:27 +00:00
<description >
2022-12-08 01:40:49 +00:00
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 [code]65535[/code] until then).
2019-05-10 23:46:27 +00:00
</description>
</method>
<method name= "get_label" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "String" />
2019-05-10 23:46:27 +00:00
<description >
2019-06-03 13:20:15 +00:00
Returns the label assigned to this channel during creation.
2019-05-10 23:46:27 +00:00
</description>
</method>
<method name= "get_max_packet_life_time" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
2019-05-10 23:46:27 +00:00
<description >
2019-06-14 22:04:55 +00:00
Returns the [code]maxPacketLifeTime[/code] value assigned to this channel during creation.
2019-06-03 13:20:15 +00:00
Will be [code]65535[/code] if not specified.
2019-05-10 23:46:27 +00:00
</description>
</method>
<method name= "get_max_retransmits" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
2019-05-10 23:46:27 +00:00
<description >
2019-06-14 22:04:55 +00:00
Returns the [code]maxRetransmits[/code] value assigned to this channel during creation.
2019-06-03 13:20:15 +00:00
Will be [code]65535[/code] if not specified.
2019-05-10 23:46:27 +00:00
</description>
</method>
<method name= "get_protocol" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "String" />
2019-05-10 23:46:27 +00:00
<description >
2019-06-14 22:04:55 +00:00
Returns the sub-protocol assigned to this channel during creation. An empty string if not specified.
2019-05-10 23:46:27 +00:00
</description>
</method>
<method name= "get_ready_state" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" enum= "WebRTCDataChannel.ChannelState" />
2019-05-10 23:46:27 +00:00
<description >
2019-06-27 09:44:37 +00:00
Returns the current state of this channel, see [enum ChannelState].
2019-05-10 23:46:27 +00:00
</description>
</method>
<method name= "is_negotiated" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "bool" />
2019-05-10 23:46:27 +00:00
<description >
2019-06-03 13:20:15 +00:00
Returns [code]true[/code] if this channel was created with out-of-band configuration.
2019-05-10 23:46:27 +00:00
</description>
</method>
<method name= "is_ordered" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "bool" />
2019-05-10 23:46:27 +00:00
<description >
2019-06-03 13:20:15 +00:00
Returns [code]true[/code] if this channel was created with ordering enabled (default).
2019-05-10 23:46:27 +00:00
</description>
</method>
<method name= "poll" >
2021-07-30 13:28:05 +00:00
<return type= "int" enum= "Error" />
2019-05-10 23:46:27 +00:00
<description >
2019-06-03 13:20:15 +00:00
Reserved, but not used for now.
2019-05-10 23:46:27 +00:00
</description>
</method>
<method name= "was_string_packet" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "bool" />
2019-05-10 23:46:27 +00:00
<description >
2019-06-14 22:04:55 +00:00
Returns [code]true[/code] if the last received packet was transferred as text. See [member write_mode].
2019-05-10 23:46:27 +00:00
</description>
</method>
</methods>
<members >
2019-06-29 10:38:01 +00:00
<member name= "write_mode" type= "int" setter= "set_write_mode" getter= "get_write_mode" enum= "WebRTCDataChannel.WriteMode" default= "1" >
2019-06-03 13:20:15 +00:00
The transfer mode to use when sending outgoing packet. Either text or binary.
2019-05-10 23:46:27 +00:00
</member>
</members>
<constants >
<constant name= "WRITE_MODE_TEXT" value= "0" enum= "WriteMode" >
2019-06-14 22:04:55 +00:00
Tells the channel to send data over this channel as text. An external peer (non-Godot) would receive this as a string.
2019-05-10 23:46:27 +00:00
</constant>
<constant name= "WRITE_MODE_BINARY" value= "1" enum= "WriteMode" >
2019-06-14 22:04:55 +00:00
Tells the channel to send data over this channel as binary. An external peer (non-Godot) would receive this as array buffer or blob.
2019-05-10 23:46:27 +00:00
</constant>
<constant name= "STATE_CONNECTING" value= "0" enum= "ChannelState" >
2019-06-03 13:20:15 +00:00
The channel was created, but it's still trying to connect.
2019-05-10 23:46:27 +00:00
</constant>
<constant name= "STATE_OPEN" value= "1" enum= "ChannelState" >
2019-06-03 13:20:15 +00:00
The channel is currently open, and data can flow over it.
2019-05-10 23:46:27 +00:00
</constant>
<constant name= "STATE_CLOSING" value= "2" enum= "ChannelState" >
2019-06-03 13:20:15 +00:00
The channel is being closed, no new messages will be accepted, but those already in queue will be flushed.
2019-05-10 23:46:27 +00:00
</constant>
<constant name= "STATE_CLOSED" value= "3" enum= "ChannelState" >
2019-06-03 13:20:15 +00:00
The channel was closed, or connection failed.
2019-05-10 23:46:27 +00:00
</constant>
</constants>
</class>