Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

StreamPeer

Inherits: RefCounted < Object

Inherited By: StreamPeerBuffer, StreamPeerExtension, StreamPeerGZIP, StreamPeerTCP, StreamPeerTLS

Abstract base class for interacting with streams.

Description

StreamPeer is an abstract base class mostly used for stream-based protocols (such as TCP). It provides an API for sending and receiving data through streams as raw data or strings.

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.

Properties

bool

big_endian

false

Methods

int

get_8 ( )

int

get_16 ( )

int

get_32 ( )

int

get_64 ( )

int

get_available_bytes ( ) const

Array

get_data ( int bytes )

float

get_double ( )

float

get_float ( )

Array

get_partial_data ( int bytes )

String

get_string ( int bytes=-1 )

int

get_u8 ( )

int

get_u16<