PacketPeer.xml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="PacketPeer" inherits="Reference" category="Core" version="3.0.alpha.custom_build">
  3. <brief_description>
  4. Abstraction and base class for packet-based protocols.
  5. </brief_description>
  6. <description>
  7. PacketPeer is an abstraction and base class for packet-based protocols (such as UDP). It provides an API for sending and receiving packets both as raw data or variables. This makes it easy to transfer data over a protocol, without having to encode data as low level bytes or having to worry about network ordering.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <demos>
  12. </demos>
  13. <methods>
  14. <method name="get_available_packet_count" qualifiers="const">
  15. <return type="int">
  16. </return>
  17. <description>
  18. Return the number of packets currently available in the ring-buffer.
  19. </description>
  20. </method>
  21. <method name="get_packet" qualifiers="const">
  22. <return type="PoolByteArray">
  23. </return>
  24. <description>
  25. Get a raw packet.
  26. </description>
  27. </method>
  28. <method name="get_packet_error" qualifiers="const">
  29. <return type="int" enum="Error">
  30. </return>
  31. <description>
  32. Return the error state of the last packet received (via [method get_packet] and [method get_var]).
  33. </description>
  34. </method>
  35. <method name="get_var" qualifiers="const">
  36. <return type="Variant">
  37. </return>
  38. <description>
  39. Get a Variant.
  40. </description>
  41. </method>
  42. <method name="is_object_decoding_allowed" qualifiers="const">
  43. <return type="bool">
  44. </return>
  45. <description>
  46. </description>
  47. </method>
  48. <method name="put_packet">
  49. <return type="int" enum="Error">
  50. </return>
  51. <argument index="0" name="buffer" type="PoolByteArray">
  52. </argument>
  53. <description>
  54. Send a raw packet.
  55. </description>
  56. </method>
  57. <method name="put_var">
  58. <return type="int" enum="Error">
  59. </return>
  60. <argument index="0" name="var" type="Variant">
  61. </argument>
  62. <description>
  63. Send a Variant as a packet.
  64. </description>
  65. </method>
  66. <method name="set_allow_object_decoding">
  67. <return type="void">
  68. </return>
  69. <argument index="0" name="enable" type="bool">
  70. </argument>
  71. <description>
  72. </description>
  73. </method>
  74. </methods>
  75. <constants>
  76. </constants>
  77. </class>