class_streampeertcp.rst 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. Numeric Constants
  28. -----------------
  29. - **STATUS_NONE** = **0** --- The initial status of the ``StreamPeerTCP``, also the status after a disconnect.
  30. - **STATUS_CONNECTING** = **1** --- A status representing a ``StreamPeerTCP`` that is connecting to a host.
  31. - **STATUS_CONNECTED** = **2** --- A status representing a ``StreamPeerTCP`` that is connected to a host.
  32. - **STATUS_ERROR** = **3** --- A staus representing a ``StreamPeerTCP`` in error state.
  33. Description
  34. -----------
  35. TCP Stream peer. This object can be used to connect to TCP servers, or also is returned by a tcp server.
  36. Member Function Description
  37. ---------------------------
  38. .. _class_StreamPeerTCP_connect_to_host:
  39. - :ref:`int<class_int>` **connect_to_host** **(** :ref:`String<class_string>` host, :ref:`int<class_int>` port **)**
  40. Connect to the specified host:port pair. A hostname will be resolved if valid. Returns OK on success or FAILED on failure.
  41. .. _class_StreamPeerTCP_disconnect_from_host:
  42. - void **disconnect_from_host** **(** **)**
  43. Disconnect from host.
  44. .. _class_StreamPeerTCP_get_connected_host:
  45. - :ref:`String<class_string>` **get_connected_host** **(** **)** const
  46. Return the IP of this peer.
  47. .. _class_StreamPeerTCP_get_connected_port:
  48. - :ref:`int<class_int>` **get_connected_port** **(** **)** const
  49. Return the port of this peer.
  50. .. _class_StreamPeerTCP_get_status:
  51. - :ref:`int<class_int>` **get_status** **(** **)** const
  52. Return the status of the connection, one of STATUS\_\* enum.
  53. .. _class_StreamPeerTCP_is_connected_to_host:
  54. - :ref:`bool<class_bool>` **is_connected_to_host** **(** **)** const