Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

StreamPeerTCP

Inherits: StreamPeer < RefCounted < Object

A stream peer that handles TCP connections.

Description

A stream peer that handles TCP connections. This object can be used to connect to TCP servers, or also is returned by a TCP server.

Note: When exporting to Android, make sure to enable the INTERNET permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android.

Methods

Error

bind ( int port, String host="*" )

Error

connect_to_host ( String host, int port )

void

disconnect_from_host ( )

String

get_connected_host ( ) const

int

get_connected_port ( ) const

int

get_local_port ( ) const

Status

get_status ( ) const

Error

poll ( )

void

set_no_delay ( bool enabled )


Enumerations

enum Status:

Status STATUS_NONE =