class_tcp_server.rst 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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:`StringArray<class_stringarray>` accepted_hosts=StringArray([]) **)** |
  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:`StringArray<class_stringarray>` accepted_hosts=StringArray([]) **)**
  32. Listen on a port using protocol, alternatively give a white-list of accepted hosts.
  33. .. _class_TCP_Server_stop:
  34. - void **stop** **(** **)**
  35. Stop listening.
  36. .. _class_TCP_Server_take_connection:
  37. - :ref:`Object<class_object>` **take_connection** **(** **)**
  38. If a connection is available, return a StreamPeerTCP with the connection/