StreamPeer

Abstraction and base class for stream-based protocols.

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

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

get16
long get16()

Get a signed 16 bit value from the stream.

get32
long get32()

Get a signed 32 bit value from the stream.

get64
long get64()

Get a signed 64 bit value from the stream.

get8
long get8()

Get a signed byte from the stream.

getAvailableBytes
long getAvailableBytes()

Return the amount of bytes this StreamPeer has available.

getData
Array getData(long bytes)

Return a chunk data with the received bytes. The amount of bytes to be received can be requested in the "bytes" argument. If not enough bytes are available, the function will block until the desired amount is received. This function returns two values, an Error code and a data array.

getDouble
double getDouble()

Get a double-precision float from the stream.

getFloat
double getFloat()

Get a single-precision float from the stream.

getPartialData
Array getPartialData(long bytes)

Return a chunk data with the received bytes. The amount of bytes to be received can be requested in the "bytes" argument. If not enough bytes are available, the function will return how many were actually received. This function returns two values, an Error code, and a data array.

getString
String getString(long bytes)

Get a string with byte-length bytes from the stream. If bytes is negative (default) the length will be read from the stream using the reverse process of putString.

getU16
long getU16()

Get an unsigned 16 bit value from the stream.

getU32
long getU32()

Get an unsigned 32 bit value from the stream.

getU64
long getU64()

Get an unsigned 64 bit value from the stream.

getU8
long getU8()

Get an unsigned byte from the stream.

getUtf8String
String getUtf8String(long bytes)

Get a utf8 string with byte-length bytes from the stream (this decodes the string sent as utf8). If bytes is negative (default) the length will be read from the stream using the reverse process of putUtf8String.

getVar
Variant getVar()

Get a Variant from the stream.

isBigEndianEnabled
bool isBigEndianEnabled()
opAssign
StreamPeer opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(StreamPeer other)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(typeof(null) n)
Undocumented in source. Be warned that the author may not have intended to support it.
put16
void put16(long value)

Put a signed 16 bit value into the stream.

put32
void put32(long value)

Put a signed 32 bit value into the stream.

put64
void put64(long value)

Put a signed 64 bit value into the stream.

put8
void put8(long value)

Put a signed byte into the stream.

putData
GodotError putData(PoolByteArray data)

Send a chunk of data through the connection, blocking if necessary until the data is done sending. This function returns an Error code.

putDouble
void putDouble(double value)

Put a double-precision float into the stream.

putFloat
void putFloat(double value)

Put a single-precision float into the stream.

putPartialData
Array putPartialData(PoolByteArray data)

Send a chunk of data through the connection, if all the data could not be sent at once, only part of it will. This function returns two values, an Error code and an integer, describing how much data was actually sent.

putString
void putString(StringArg0 value)

Put a zero-terminated ascii string into the stream prepended by a 32 bits unsigned integer representing its size.

putU16
void putU16(long value)

Put an unsigned 16 bit value into the stream.

putU32
void putU32(long value)

Put an unsigned 32 bit value into the stream.

putU64
void putU64(long value)

Put an unsigned 64 bit value into the stream.

putU8
void putU8(long value)

Put an unsigned byte into the stream.

putUtf8String
void putUtf8String(StringArg0 value)

Put a zero-terminated utf8 string into the stream prepended by a 32 bits unsigned integer representing its size.

putVar
void putVar(VariantArg0 value)

Put a Variant into the stream.

setBigEndian
void setBigEndian(bool enable)

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

bigEndian
bool bigEndian [@property getter]
bool bigEndian [@property setter]

If true, this StreamPeer will using big-endian format for encoding and decoding.

Static functions

_new
StreamPeer _new()
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

_classBinding
struct _classBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
ToRef as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta