class_webrtcdatachannel.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/modules/webrtc/doc_classes/WebRTCDataChannel.xml.
  6. .. _class_WebRTCDataChannel:
  7. WebRTCDataChannel
  8. =================
  9. **Inherits:** :ref:`PacketPeer<class_PacketPeer>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`WebRTCDataChannelExtension<class_WebRTCDataChannelExtension>`
  11. .. container:: contribute
  12. There is currently no description for this class. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  13. .. rst-class:: classref-reftable-group
  14. Properties
  15. ----------
  16. .. table::
  17. :widths: auto
  18. +----------------------------------------------------+----------------------------------------------------------------+-------+
  19. | :ref:`WriteMode<enum_WebRTCDataChannel_WriteMode>` | :ref:`write_mode<class_WebRTCDataChannel_property_write_mode>` | ``1`` |
  20. +----------------------------------------------------+----------------------------------------------------------------+-------+
  21. .. rst-class:: classref-reftable-group
  22. Methods
  23. -------
  24. .. table::
  25. :widths: auto
  26. +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+
  27. | |void| | :ref:`close<class_WebRTCDataChannel_method_close>`\ (\ ) |
  28. +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+
  29. | :ref:`int<class_int>` | :ref:`get_buffered_amount<class_WebRTCDataChannel_method_get_buffered_amount>`\ (\ ) |const| |
  30. +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+
  31. | :ref:`int<class_int>` | :ref:`get_id<class_WebRTCDataChannel_method_get_id>`\ (\ ) |const| |
  32. +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+
  33. | :ref:`String<class_String>` | :ref:`get_label<class_WebRTCDataChannel_method_get_label>`\ (\ ) |const| |
  34. +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+
  35. | :ref:`int<class_int>` | :ref:`get_max_packet_life_time<class_WebRTCDataChannel_method_get_max_packet_life_time>`\ (\ ) |const| |
  36. +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+
  37. | :ref:`int<class_int>` | :ref:`get_max_retransmits<class_WebRTCDataChannel_method_get_max_retransmits>`\ (\ ) |const| |
  38. +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+
  39. | :ref:`String<class_String>` | :ref:`get_protocol<class_WebRTCDataChannel_method_get_protocol>`\ (\ ) |const| |
  40. +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+
  41. | :ref:`ChannelState<enum_WebRTCDataChannel_ChannelState>` | :ref:`get_ready_state<class_WebRTCDataChannel_method_get_ready_state>`\ (\ ) |const| |
  42. +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+
  43. | :ref:`bool<class_bool>` | :ref:`is_negotiated<class_WebRTCDataChannel_method_is_negotiated>`\ (\ ) |const| |
  44. +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+
  45. | :ref:`bool<class_bool>` | :ref:`is_ordered<class_WebRTCDataChannel_method_is_ordered>`\ (\ ) |const| |
  46. +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+
  47. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`poll<class_WebRTCDataChannel_method_poll>`\ (\ ) |
  48. +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+
  49. | :ref:`bool<class_bool>` | :ref:`was_string_packet<class_WebRTCDataChannel_method_was_string_packet>`\ (\ ) |const| |
  50. +----------------------------------------------------------+--------------------------------------------------------------------------------------------------------+
  51. .. rst-class:: classref-section-separator
  52. ----
  53. .. rst-class:: classref-descriptions-group
  54. Enumerations
  55. ------------
  56. .. _enum_WebRTCDataChannel_WriteMode:
  57. .. rst-class:: classref-enumeration
  58. enum **WriteMode**: :ref:`🔗<enum_WebRTCDataChannel_WriteMode>`
  59. .. _class_WebRTCDataChannel_constant_WRITE_MODE_TEXT:
  60. .. rst-class:: classref-enumeration-constant
  61. :ref:`WriteMode<enum_WebRTCDataChannel_WriteMode>` **WRITE_MODE_TEXT** = ``0``
  62. Tells the channel to send data over this channel as text. An external peer (non-Godot) would receive this as a string.
  63. .. _class_WebRTCDataChannel_constant_WRITE_MODE_BINARY:
  64. .. rst-class:: classref-enumeration-constant
  65. :ref:`WriteMode<enum_WebRTCDataChannel_WriteMode>` **WRITE_MODE_BINARY** = ``1``
  66. Tells the channel to send data over this channel as binary. An external peer (non-Godot) would receive this as array buffer or blob.
  67. .. rst-class:: classref-item-separator
  68. ----
  69. .. _enum_WebRTCDataChannel_ChannelState:
  70. .. rst-class:: classref-enumeration
  71. enum **ChannelState**: :ref:`🔗<enum_WebRTCDataChannel_ChannelState>`
  72. .. _class_WebRTCDataChannel_constant_STATE_CONNECTING:
  73. .. rst-class:: classref-enumeration-constant
  74. :ref:`ChannelState<enum_WebRTCDataChannel_ChannelState>` **STATE_CONNECTING** = ``0``
  75. The channel was created, but it's still trying to connect.
  76. .. _class_WebRTCDataChannel_constant_STATE_OPEN:
  77. .. rst-class:: classref-enumeration-constant
  78. :ref:`ChannelState<enum_WebRTCDataChannel_ChannelState>` **STATE_OPEN** = ``1``
  79. The channel is currently open, and data can flow over it.
  80. .. _class_WebRTCDataChannel_constant_STATE_CLOSING:
  81. .. rst-class:: classref-enumeration-constant
  82. :ref:`ChannelState<enum_WebRTCDataChannel_ChannelState>` **STATE_CLOSING** = ``2``
  83. The channel is being closed, no new messages will be accepted, but those already in queue will be flushed.
  84. .. _class_WebRTCDataChannel_constant_STATE_CLOSED:
  85. .. rst-class:: classref-enumeration-constant
  86. :ref:`ChannelState<enum_WebRTCDataChannel_ChannelState>` **STATE_CLOSED** = ``3``
  87. The channel was closed, or connection failed.
  88. .. rst-class:: classref-section-separator
  89. ----
  90. .. rst-class:: classref-descriptions-group
  91. Property Descriptions
  92. ---------------------
  93. .. _class_WebRTCDataChannel_property_write_mode:
  94. .. rst-class:: classref-property
  95. :ref:`WriteMode<enum_WebRTCDataChannel_WriteMode>` **write_mode** = ``1`` :ref:`🔗<class_WebRTCDataChannel_property_write_mode>`
  96. .. rst-class:: classref-property-setget
  97. - |void| **set_write_mode**\ (\ value\: :ref:`WriteMode<enum_WebRTCDataChannel_WriteMode>`\ )
  98. - :ref:`WriteMode<enum_WebRTCDataChannel_WriteMode>` **get_write_mode**\ (\ )
  99. The transfer mode to use when sending outgoing packet. Either text or binary.
  100. .. rst-class:: classref-section-separator
  101. ----
  102. .. rst-class:: classref-descriptions-group
  103. Method Descriptions
  104. -------------------
  105. .. _class_WebRTCDataChannel_method_close:
  106. .. rst-class:: classref-method
  107. |void| **close**\ (\ ) :ref:`🔗<class_WebRTCDataChannel_method_close>`
  108. Closes this data channel, notifying the other peer.
  109. .. rst-class:: classref-item-separator
  110. ----
  111. .. _class_WebRTCDataChannel_method_get_buffered_amount:
  112. .. rst-class:: classref-method
  113. :ref:`int<class_int>` **get_buffered_amount**\ (\ ) |const| :ref:`🔗<class_WebRTCDataChannel_method_get_buffered_amount>`
  114. Returns the number of bytes currently queued to be sent over this channel.
  115. .. rst-class:: classref-item-separator
  116. ----
  117. .. _class_WebRTCDataChannel_method_get_id:
  118. .. rst-class:: classref-method
  119. :ref:`int<class_int>` **get_id**\ (\ ) |const| :ref:`🔗<class_WebRTCDataChannel_method_get_id>`
  120. Returns the ID assigned to this channel during creation (or auto-assigned during negotiation).
  121. 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).
  122. .. rst-class:: classref-item-separator
  123. ----
  124. .. _class_WebRTCDataChannel_method_get_label:
  125. .. rst-class:: classref-method
  126. :ref:`String<class_String>` **get_label**\ (\ ) |const| :ref:`🔗<class_WebRTCDataChannel_method_get_label>`
  127. Returns the label assigned to this channel during creation.
  128. .. rst-class:: classref-item-separator
  129. ----
  130. .. _class_WebRTCDataChannel_method_get_max_packet_life_time:
  131. .. rst-class:: classref-method
  132. :ref:`int<class_int>` **get_max_packet_life_time**\ (\ ) |const| :ref:`🔗<class_WebRTCDataChannel_method_get_max_packet_life_time>`
  133. Returns the ``maxPacketLifeTime`` value assigned to this channel during creation.
  134. Will be ``65535`` if not specified.
  135. .. rst-class:: classref-item-separator
  136. ----
  137. .. _class_WebRTCDataChannel_method_get_max_retransmits:
  138. .. rst-class:: classref-method
  139. :ref:`int<class_int>` **get_max_retransmits**\ (\ ) |const| :ref:`🔗<class_WebRTCDataChannel_method_get_max_retransmits>`
  140. Returns the ``maxRetransmits`` value assigned to this channel during creation.
  141. Will be ``65535`` if not specified.
  142. .. rst-class:: classref-item-separator
  143. ----
  144. .. _class_WebRTCDataChannel_method_get_protocol:
  145. .. rst-class:: classref-method
  146. :ref:`String<class_String>` **get_protocol**\ (\ ) |const| :ref:`🔗<class_WebRTCDataChannel_method_get_protocol>`
  147. Returns the sub-protocol assigned to this channel during creation. An empty string if not specified.
  148. .. rst-class:: classref-item-separator
  149. ----
  150. .. _class_WebRTCDataChannel_method_get_ready_state:
  151. .. rst-class:: classref-method
  152. :ref:`ChannelState<enum_WebRTCDataChannel_ChannelState>` **get_ready_state**\ (\ ) |const| :ref:`🔗<class_WebRTCDataChannel_method_get_ready_state>`
  153. Returns the current state of this channel, see :ref:`ChannelState<enum_WebRTCDataChannel_ChannelState>`.
  154. .. rst-class:: classref-item-separator
  155. ----
  156. .. _class_WebRTCDataChannel_method_is_negotiated:
  157. .. rst-class:: classref-method
  158. :ref:`bool<class_bool>` **is_negotiated**\ (\ ) |const| :ref:`🔗<class_WebRTCDataChannel_method_is_negotiated>`
  159. Returns ``true`` if this channel was created with out-of-band configuration.
  160. .. rst-class:: classref-item-separator
  161. ----
  162. .. _class_WebRTCDataChannel_method_is_ordered:
  163. .. rst-class:: classref-method
  164. :ref:`bool<class_bool>` **is_ordered**\ (\ ) |const| :ref:`🔗<class_WebRTCDataChannel_method_is_ordered>`
  165. Returns ``true`` if this channel was created with ordering enabled (default).
  166. .. rst-class:: classref-item-separator
  167. ----
  168. .. _class_WebRTCDataChannel_method_poll:
  169. .. rst-class:: classref-method
  170. :ref:`Error<enum_@GlobalScope_Error>` **poll**\ (\ ) :ref:`🔗<class_WebRTCDataChannel_method_poll>`
  171. Reserved, but not used for now.
  172. .. rst-class:: classref-item-separator
  173. ----
  174. .. _class_WebRTCDataChannel_method_was_string_packet:
  175. .. rst-class:: classref-method
  176. :ref:`bool<class_bool>` **was_string_packet**\ (\ ) |const| :ref:`🔗<class_WebRTCDataChannel_method_was_string_packet>`
  177. Returns ``true`` if the last received packet was transferred as text. See :ref:`write_mode<class_WebRTCDataChannel_property_write_mode>`.
  178. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  179. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  180. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  181. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  182. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  183. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  184. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  185. .. |void| replace:: :abbr:`void (No return value.)`