WebRTCDataChannel.xml 4.0 KB

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