WebRTCDataChannel.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="WebRTCDataChannel" inherits="PacketPeer" version="4.0">
  3. <brief_description>
  4. </brief_description>
  5. <description>
  6. </description>
  7. <tutorials>
  8. </tutorials>
  9. <methods>
  10. <method name="close">
  11. <return type="void">
  12. </return>
  13. <description>
  14. Closes this data channel, notifying the other peer.
  15. </description>
  16. </method>
  17. <method name="get_id" qualifiers="const">
  18. <return type="int">
  19. </return>
  20. <description>
  21. Returns the id assigned to this channel during creation (or auto-assigned during negotiation).
  22. 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).
  23. </description>
  24. </method>
  25. <method name="get_label" qualifiers="const">
  26. <return type="String">
  27. </return>
  28. <description>
  29. Returns the label assigned to this channel during creation.
  30. </description>
  31. </method>
  32. <method name="get_max_packet_life_time" qualifiers="const">
  33. <return type="int">
  34. </return>
  35. <description>
  36. Returns the [code]maxPacketLifeTime[/code] value assigned to this channel during creation.
  37. Will be [code]65535[/code] if not specified.
  38. </description>
  39. </method>
  40. <method name="get_max_retransmits" qualifiers="const">
  41. <return type="int">
  42. </return>
  43. <description>
  44. Returns the [code]maxRetransmits[/code] value assigned to this channel during creation.
  45. Will be [code]65535[/code] if not specified.
  46. </description>
  47. </method>
  48. <method name="get_protocol" qualifiers="const">
  49. <return type="String">
  50. </return>
  51. <description>
  52. Returns the sub-protocol assigned to this channel during creation. An empty string if not specified.
  53. </description>
  54. </method>
  55. <method name="get_ready_state" qualifiers="const">
  56. <return type="int" enum="WebRTCDataChannel.ChannelState">
  57. </return>
  58. <description>
  59. Returns the current state of this channel, see [enum ChannelState].
  60. </description>
  61. </method>
  62. <method name="is_negotiated" qualifiers="const">
  63. <return type="bool">
  64. </return>
  65. <description>
  66. Returns [code]true[/code] if this channel was created with out-of-band configuration.
  67. </description>
  68. </method>
  69. <method name="is_ordered" qualifiers="const">
  70. <return type="bool">
  71. </return>
  72. <description>
  73. Returns [code]true[/code] if this channel was created with ordering enabled (default).
  74. </description>
  75. </method>
  76. <method name="poll">
  77. <return type="int" enum="Error">
  78. </return>
  79. <description>
  80. Reserved, but not used for now.
  81. </description>
  82. </method>
  83. <method name="was_string_packet" qualifiers="const">
  84. <return type="bool">
  85. </return>
  86. <description>
  87. Returns [code]true[/code] if the last received packet was transferred as text. See [member write_mode].
  88. </description>
  89. </method>
  90. </methods>
  91. <members>
  92. <member name="write_mode" type="int" setter="set_write_mode" getter="get_write_mode" enum="WebRTCDataChannel.WriteMode" default="1">
  93. The transfer mode to use when sending outgoing packet. Either text or binary.
  94. </member>
  95. </members>
  96. <constants>
  97. <constant name="WRITE_MODE_TEXT" value="0" enum="WriteMode">
  98. Tells the channel to send data over this channel as text. An external peer (non-Godot) would receive this as a string.
  99. </constant>
  100. <constant name="WRITE_MODE_BINARY" value="1" enum="WriteMode">
  101. Tells the channel to send data over this channel as binary. An external peer (non-Godot) would receive this as array buffer or blob.
  102. </constant>
  103. <constant name="STATE_CONNECTING" value="0" enum="ChannelState">
  104. The channel was created, but it's still trying to connect.
  105. </constant>
  106. <constant name="STATE_OPEN" value="1" enum="ChannelState">
  107. The channel is currently open, and data can flow over it.
  108. </constant>
  109. <constant name="STATE_CLOSING" value="2" enum="ChannelState">
  110. The channel is being closed, no new messages will be accepted, but those already in queue will be flushed.
  111. </constant>
  112. <constant name="STATE_CLOSED" value="3" enum="ChannelState">
  113. The channel was closed, or connection failed.
  114. </constant>
  115. </constants>
  116. </class>