TCP stream peer.
public class StreamPeerTCP : StreamPeer
TCP stream peer. This object can be used to connect to TCP servers, or also is returned by a TCP server.
public Error ConnectToHost(string host, int port)
public void DisconnectFromHost()
public string GetConnectedHost()
public ushort GetConnectedPort()
public Status GetStatus()
Returns the status of the connection, see Status.
public bool IsConnectedToHost()
public void SetNoDelay(bool enabled)
Disables Nagle’s algorithm to improve latency for small packets.
|None||0||The initial status of the [StreamPeerTCP]. This is also the status after disconnecting.|
|Connecting||1||A status representing a [StreamPeerTCP] that is connecting to a host.|
|Connected||2||A status representing a [StreamPeerTCP] that is connected to a host.|
|Error||3||A status representing a [StreamPeerTCP] in error state.|