StreamPeerTCP
TCP stream peer.
TCP stream peer. This object can be used to connect to TCP servers, or also is returned by a TCP server.
enum Status:
- STATUS_CONNECTING = 1 —- A status representing a
StreamPeerTCP
that is connecting to a host. - STATUS_CONNECTED = 2 —- A status representing a that is connected to a host.
- STATUS_ERROR = 3 —- A status representing a
StreamPeerTCP
in error state.
- connect_to_host ( String host, port )
Disconnects from host.
- String get_connected_host ( ) const
Returns the IP of this peer.
- get_connected_port ( ) const
Returns the port of this peer.
- Status get_status ( )
- is_connected_to_host ( ) const
Returns true
if this peer is currently connected or is connecting to a host, otherwise.
Disables Nagle’s algorithm to improve latency for small packets.
Note: For applications that send large packets or need to transfer a lot of data, this can decrease the total available bandwidth.