TCP_Server.xml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="TCP_Server" inherits="Reference" category="Core" version="3.0.alpha.custom_build">
  3. <brief_description>
  4. TCP Server.
  5. </brief_description>
  6. <description>
  7. TCP Server class. Listens to connections on a port and returns a [StreamPeerTCP] when got a connection.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <demos>
  12. </demos>
  13. <methods>
  14. <method name="is_connection_available" qualifiers="const">
  15. <return type="bool">
  16. </return>
  17. <description>
  18. Return true if a connection is available for taking.
  19. </description>
  20. </method>
  21. <method name="listen">
  22. <return type="int" enum="Error">
  23. </return>
  24. <argument index="0" name="port" type="int">
  25. </argument>
  26. <argument index="1" name="bind_address" type="String" default="&quot;*&quot;">
  27. </argument>
  28. <description>
  29. Listen on the "port" binding to "bind_address".
  30. If "bind_address" is set as "*" (default), the server will listen on all available addresses (both IPv4 and IPv6).
  31. If "bind_address" is set as "0.0.0.0" (for IPv4) or "::" (for IPv6), the server will listen on all available addresses matching that IP type.
  32. If "bind_address" is set to any valid address (e.g. "192.168.1.101", "::1", etc), the server will only listen on the interface with that addresses (or fail if no interface with the given address exists).
  33. </description>
  34. </method>
  35. <method name="stop">
  36. <return type="void">
  37. </return>
  38. <description>
  39. Stop listening.
  40. </description>
  41. </method>
  42. <method name="take_connection">
  43. <return type="StreamPeerTCP">
  44. </return>
  45. <description>
  46. If a connection is available, return a StreamPeerTCP with the connection/
  47. </description>
  48. </method>
  49. </methods>
  50. <constants>
  51. </constants>
  52. </class>