123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- :github_url: hide
- .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
- .. DO NOT EDIT THIS FILE, but the WebRTCDataChannel.xml source instead.
- .. The source is found in doc/classes or modules/<name>/doc_classes.
- .. _class_WebRTCDataChannel:
- WebRTCDataChannel
- =================
- **Inherits:** :ref:`PacketPeer<class_PacketPeer>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
- **Inherited By:** :ref:`WebRTCDataChannelGDNative<class_WebRTCDataChannelGDNative>`
- Properties
- ----------
- +----------------------------------------------------+----------------------------------------------------------------+-------+
- | :ref:`WriteMode<enum_WebRTCDataChannel_WriteMode>` | :ref:`write_mode<class_WebRTCDataChannel_property_write_mode>` | ``1`` |
- +----------------------------------------------------+----------------------------------------------------------------+-------+
- Methods
- -------
- +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
- | void | :ref:`close<class_WebRTCDataChannel_method_close>` **(** **)** |
- +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_buffered_amount<class_WebRTCDataChannel_method_get_buffered_amount>` **(** **)** |const| |
- +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_id<class_WebRTCDataChannel_method_get_id>` **(** **)** |const| |
- +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`get_label<class_WebRTCDataChannel_method_get_label>` **(** **)** |const| |
- +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_max_packet_life_time<class_WebRTCDataChannel_method_get_max_packet_life_time>` **(** **)** |const| |
- +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_max_retransmits<class_WebRTCDataChannel_method_get_max_retransmits>` **(** **)** |const| |
- +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`get_protocol<class_WebRTCDataChannel_method_get_protocol>` **(** **)** |const| |
- +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
- | :ref:`ChannelState<enum_WebRTCDataChannel_ChannelState>` | :ref:`get_ready_state<class_WebRTCDataChannel_method_get_ready_state>` **(** **)** |const| |
- +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_negotiated<class_WebRTCDataChannel_method_is_negotiated>` **(** **)** |const| |
- +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_ordered<class_WebRTCDataChannel_method_is_ordered>` **(** **)** |const| |
- +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
- | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`poll<class_WebRTCDataChannel_method_poll>` **(** **)** |
- +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`was_string_packet<class_WebRTCDataChannel_method_was_string_packet>` **(** **)** |const| |
- +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+
- Enumerations
- ------------
- .. _enum_WebRTCDataChannel_WriteMode:
- .. _class_WebRTCDataChannel_constant_WRITE_MODE_TEXT:
- .. _class_WebRTCDataChannel_constant_WRITE_MODE_BINARY:
- 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_WebRTCDataChannel_ChannelState:
- .. _class_WebRTCDataChannel_constant_STATE_CONNECTING:
- .. _class_WebRTCDataChannel_constant_STATE_OPEN:
- .. _class_WebRTCDataChannel_constant_STATE_CLOSING:
- .. _class_WebRTCDataChannel_constant_STATE_CLOSED:
- 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.
- Property Descriptions
- ---------------------
- .. _class_WebRTCDataChannel_property_write_mode:
- - :ref:`WriteMode<enum_WebRTCDataChannel_WriteMode>` **write_mode**
- +-----------+-----------------------+
- | *Default* | ``1`` |
- +-----------+-----------------------+
- | *Setter* | set_write_mode(value) |
- +-----------+-----------------------+
- | *Getter* | get_write_mode() |
- +-----------+-----------------------+
- The transfer mode to use when sending outgoing packet. Either text or binary.
- Method Descriptions
- -------------------
- .. _class_WebRTCDataChannel_method_close:
- - void **close** **(** **)**
- Closes this data channel, notifying the other peer.
- ----
- .. _class_WebRTCDataChannel_method_get_buffered_amount:
- - :ref:`int<class_int>` **get_buffered_amount** **(** **)** |const|
- Returns the number of bytes currently queued to be sent over this channel.
- ----
- .. _class_WebRTCDataChannel_method_get_id:
- - :ref:`int<class_int>` **get_id** **(** **)** |const|
- 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).
- ----
- .. _class_WebRTCDataChannel_method_get_label:
- - :ref:`String<class_String>` **get_label** **(** **)** |const|
- Returns the label assigned to this channel during creation.
- ----
- .. _class_WebRTCDataChannel_method_get_max_packet_life_time:
- - :ref:`int<class_int>` **get_max_packet_life_time** **(** **)** |const|
- Returns the ``maxPacketLifeTime`` value assigned to this channel during creation.
- Will be ``65535`` if not specified.
- ----
- .. _class_WebRTCDataChannel_method_get_max_retransmits:
- - :ref:`int<class_int>` **get_max_retransmits** **(** **)** |const|
- Returns the ``maxRetransmits`` value assigned to this channel during creation.
- Will be ``65535`` if not specified.
- ----
- .. _class_WebRTCDataChannel_method_get_protocol:
- - :ref:`String<class_String>` **get_protocol** **(** **)** |const|
- Returns the sub-protocol assigned to this channel during creation. An empty string if not specified.
- ----
- .. _class_WebRTCDataChannel_method_get_ready_state:
- - :ref:`ChannelState<enum_WebRTCDataChannel_ChannelState>` **get_ready_state** **(** **)** |const|
- Returns the current state of this channel, see :ref:`ChannelState<enum_WebRTCDataChannel_ChannelState>`.
- ----
- .. _class_WebRTCDataChannel_method_is_negotiated:
- - :ref:`bool<class_bool>` **is_negotiated** **(** **)** |const|
- Returns ``true`` if this channel was created with out-of-band configuration.
- ----
- .. _class_WebRTCDataChannel_method_is_ordered:
- - :ref:`bool<class_bool>` **is_ordered** **(** **)** |const|
- Returns ``true`` if this channel was created with ordering enabled (default).
- ----
- .. _class_WebRTCDataChannel_method_poll:
- - :ref:`Error<enum_@GlobalScope_Error>` **poll** **(** **)**
- Reserved, but not used for now.
- ----
- .. _class_WebRTCDataChannel_method_was_string_packet:
- - :ref:`bool<class_bool>` **was_string_packet** **(** **)** |const|
- Returns ``true`` if the last received packet was transferred as text. See :ref:`write_mode<class_WebRTCDataChannel_property_write_mode>`.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|