TCP_Server.xml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="TCP_Server" inherits="Reference" category="Core" version="3.1.2">
  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. <methods>
  12. <method name="is_connection_available" qualifiers="const">
  13. <return type="bool">
  14. </return>
  15. <description>
  16. Returns [code]true[/code] if a connection is available for taking.
  17. </description>
  18. </method>
  19. <method name="listen">
  20. <return type="int" enum="Error">
  21. </return>
  22. <argument index="0" name="port" type="int">
  23. </argument>
  24. <argument index="1" name="bind_address" type="String" default="&quot;*&quot;">
  25. </argument>
  26. <description>
  27. Listen on the "port" binding to "bind_address".
  28. If "bind_address" is set as "*" (default), the server will listen on all available addresses (both IPv4 and IPv6).
  29. 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.
  30. 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).
  31. </description>
  32. </method>
  33. <method name="stop">
  34. <return type="void">
  35. </return>
  36. <description>
  37. Stop listening.
  38. </description>
  39. </method>
  40. <method name="take_connection">
  41. <return type="StreamPeerTCP">
  42. </return>
  43. <description>
  44. If a connection is available, return a StreamPeerTCP with the connection/
  45. </description>
  46. </method>
  47. </methods>
  48. <constants>
  49. </constants>
  50. </class>