class_streampeertcp.rst 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the StreamPeerTCP.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_StreamPeerTCP:
  5. StreamPeerTCP
  6. =============
  7. **Inherits:** :ref:`StreamPeer<class_streampeer>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. TCP Stream peer.
  12. Member Functions
  13. ----------------
  14. +------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`int<class_int>` | :ref:`connect_to_host<class_StreamPeerTCP_connect_to_host>` **(** :ref:`String<class_string>` host, :ref:`int<class_int>` port **)** |
  16. +------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  17. | void | :ref:`disconnect_from_host<class_StreamPeerTCP_disconnect_from_host>` **(** **)** |
  18. +------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`String<class_string>` | :ref:`get_connected_host<class_StreamPeerTCP_get_connected_host>` **(** **)** const |
  20. +------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`int<class_int>` | :ref:`get_connected_port<class_StreamPeerTCP_get_connected_port>` **(** **)** const |
  22. +------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`int<class_int>` | :ref:`get_status<class_StreamPeerTCP_get_status>` **(** **)** const |
  24. +------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`bool<class_bool>` | :ref:`is_connected_to_host<class_StreamPeerTCP_is_connected_to_host>` **(** **)** const |
  26. +------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  27. Enums
  28. -----
  29. .. _enum_StreamPeerTCP_Status:
  30. enum **Status**
  31. - **STATUS_NONE** = **0** --- The initial status of the ``StreamPeerTCP``, also the status after a disconnect.
  32. - **STATUS_CONNECTING** = **1** --- A status representing a ``StreamPeerTCP`` that is connecting to a host.
  33. - **STATUS_CONNECTED** = **2** --- A status representing a ``StreamPeerTCP`` that is connected to a host.
  34. - **STATUS_ERROR** = **3** --- A staus representing a ``StreamPeerTCP`` in error state.
  35. Description
  36. -----------
  37. TCP Stream peer. This object can be used to connect to TCP servers, or also is returned by a tcp server.
  38. Member Function Description
  39. ---------------------------
  40. .. _class_StreamPeerTCP_connect_to_host:
  41. - :ref:`int<class_int>` **connect_to_host** **(** :ref:`String<class_string>` host, :ref:`int<class_int>` port **)**
  42. Connect to the specified host:port pair. A hostname will be resolved if valid. Returns OK on success or FAILED on failure.
  43. .. _class_StreamPeerTCP_disconnect_from_host:
  44. - void **disconnect_from_host** **(** **)**
  45. Disconnect from host.
  46. .. _class_StreamPeerTCP_get_connected_host:
  47. - :ref:`String<class_string>` **get_connected_host** **(** **)** const
  48. Return the IP of this peer.
  49. .. _class_StreamPeerTCP_get_connected_port:
  50. - :ref:`int<class_int>` **get_connected_port** **(** **)** const
  51. Return the port of this peer.
  52. .. _class_StreamPeerTCP_get_status:
  53. - :ref:`int<class_int>` **get_status** **(** **)** const
  54. Return the status of the connection, one of STATUS\_\* enum.
  55. .. _class_StreamPeerTCP_is_connected_to_host:
  56. - :ref:`bool<class_bool>` **is_connected_to_host** **(** **)** const