Inherits: StreamPeer < Reference < Object
TCP stream peer.
TCP stream peer. This object can be used to connect to TCP servers, or also is returned by a TCP server.
Error | connect_to_host ( String host, int port ) |
void | disconnect_from_host ( ) |
String | get_connected_host ( ) const |
int | get_connected_port ( ) const |
Status | get_status ( ) |
bool | is_connected_to_host ( ) const |
void | set_no_delay ( bool enabled ) |
enum Status:
StreamPeerTCP
. This is also the status after disconnecting.StreamPeerTCP
that is connecting to a host.StreamPeerTCP
that is connected to a host.StreamPeerTCP
in error state.Connects to the specified host:port
pair. A hostname will be resolved if valid. Returns @GlobalScope.OK on success or @GlobalScope.FAILED on failure.
Disconnects from host.
Returns the IP of this peer.
Returns the port of this peer.
Returns the status of the connection, see Status.
Returns true
if this peer is currently connected to a host, false
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.
© 2014–2020 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
https://docs.godotengine.org/en/3.2/classes/class_streampeertcp.html