class_tcp_server.rst 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_TCP_Server:
  4. TCP_Server
  5. ==========
  6. **Inherits:** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. TCP Server.
  11. Member Functions
  12. ----------------
  13. +------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  14. | :ref:`bool<class_bool>` | :ref:`is_connection_available<class_TCP_Server_is_connection_available>` **(** **)** const |
  15. +------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`int<class_int>` | :ref:`listen<class_TCP_Server_listen>` **(** :ref:`int<class_int>` port, :ref:`String<class_string>` bind_address="*" **)** |
  17. +------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  18. | void | :ref:`stop<class_TCP_Server_stop>` **(** **)** |
  19. +------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`Object<class_object>` | :ref:`take_connection<class_TCP_Server_take_connection>` **(** **)** |
  21. +------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
  22. Description
  23. -----------
  24. TCP Server class. Listens to connections on a port and returns a :ref:`StreamPeerTCP<class_streampeertcp>` when got a connection.
  25. Member Function Description
  26. ---------------------------
  27. .. _class_TCP_Server_is_connection_available:
  28. - :ref:`bool<class_bool>` **is_connection_available** **(** **)** const
  29. Return true if a connection is available for taking.
  30. .. _class_TCP_Server_listen:
  31. - :ref:`int<class_int>` **listen** **(** :ref:`int<class_int>` port, :ref:`String<class_string>` bind_address="*" **)**
  32. Listen on the "port" binding to "bind_address".
  33. If "bind_address" is set as "\*" (default), the server will listen on all available addresses (both IPv4 and IPv6).
  34. 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.
  35. 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).
  36. .. _class_TCP_Server_stop:
  37. - void **stop** **(** **)**
  38. Stop listening.
  39. .. _class_TCP_Server_take_connection:
  40. - :ref:`Object<class_object>` **take_connection** **(** **)**
  41. If a connection is available, return a StreamPeerTCP with the connection/