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¶
|
Methods¶
get_8 ( ) |
|
get_16 ( ) |
|
get_32 ( ) |
|
get_64 ( ) |
|
get_available_bytes ( ) const |
|
get_double ( ) |
|
get_float ( ) |
|
get_partial_data ( int bytes ) |
|
get_string ( int bytes=-1 ) |
|
get_u8 ( ) |
|
get_u16 ( ) |
|
get_u32 ( ) |
|
get_u64 ( ) |
|
get_utf8_string ( int bytes=-1 ) |
|
void |
|
void |
|
void |
|
void |
|
put_data ( PackedByteArray data ) |
|
void |
put_double ( float value ) |
void |
|
put_partial_data ( PackedByteArray data ) |
|
void |
put_string ( String value ) |
void |
|
void |
|
void |
|
void |
|
void |
put_utf8_string ( String value ) |
void |
Property Descriptions¶
bool big_endian = false
If true
, this StreamPeer will using big-endian format for encoding and decoding.
Method Descriptions¶
int get_8 ( )
Gets a signed byte from the stream.
int get_16 ( )
Gets a signed 16-bit value from the stream.
int get_32 ( )
Gets a signed 32-bit value from the stream.
int get_64 ( )
Gets a signed 64-bit value from the stream.