PacketPeer.xml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="PacketPeer" inherits="Reference" category="Core" version="3.1">
  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">
  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">
  36. <return type="Variant">
  37. </return>
  38. <description>
  39. Get a Variant.
  40. </description>
  41. </method>
  42. <method name="put_packet">
  43. <return type="int" enum="Error">
  44. </return>
  45. <argument index="0" name="buffer" type="PoolByteArray">
  46. </argument>
  47. <description>
  48. Send a raw packet.
  49. </description>
  50. </method>
  51. <method name="put_var">
  52. <return type="int" enum="Error">
  53. </return>
  54. <argument index="0" name="var" type="Variant">
  55. </argument>
  56. <description>
  57. Send a Variant as a packet.
  58. </description>
  59. </method>
  60. </methods>
  61. <members>
  62. <member name="allow_object_decoding" type="bool" setter="set_allow_object_decoding" getter="is_object_decoding_allowed">
  63. </member>
  64. </members>
  65. <constants>
  66. </constants>
  67. </class>