WebRTCDataChannel.xml 4.3 KB

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