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.

StreamPeerSocket๏ƒ

Inherits: StreamPeer < RefCounted < Object

Inherited By: StreamPeerTCP, StreamPeerUDS

Abstract base class for interacting with socket streams.

Description๏ƒ

StreamPeerSocket is an abstract base class that defines common behavior for socket-based streams.

Methods๏ƒ

void

disconnect_from_host()

Status

get_status() const

Error

poll()


Enumerations๏ƒ

enum Status: ๐Ÿ”—

Status STATUS_NONE = 0

The initial status of the StreamPeerSocket. This is also the status after disconnecting.

Status STATUS_CONNECTING = 1

A status representing a StreamPeerSocket that is connecting to a host.

Status STATUS_CONNECTED = 2

A status representing a StreamPeerSocket that is connected to a host.

Status STATUS_ERROR = 3

A status representing a StreamPeerSocket in error state.


Method Descriptions๏ƒ

void disconnect_from_host() ๐Ÿ”—

Disconnects from host.


Status get_status() const ๐Ÿ”—

Returns the status of the connection.


Error poll() ๐Ÿ”—

Polls the socket, updating its state. See get_status().