32 #include "reference.h" 36 OBJ_CATEGORY(
"Networking");
38 static void _bind_methods();
44 Array _get_data(
int p_bytes);
45 Array _get_partial_data(
int p_bytes);
51 virtual Error
put_data(
const uint8_t* p_data,
int p_bytes)=0;
52 virtual Error
put_partial_data(
const uint8_t* p_data,
int p_bytes,
int &r_sent)=0;
54 virtual Error
get_data(uint8_t* p_buffer,
int p_bytes)=0;
55 virtual Error
get_partial_data(uint8_t* p_buffer,
int p_bytes,
int &r_received)=0;
57 virtual int get_available_bytes()
const=0;
59 void set_big_endian(
bool p_enable);
60 bool is_big_endian_enabled()
const;
62 void put_8(int8_t p_val);
63 void put_u8(uint8_t p_val);
64 void put_16(int16_t p_val);
65 void put_u16(uint16_t p_val);
66 void put_32(int32_t p_val);
67 void put_u32(uint32_t p_val);
68 void put_64(int64_t p_val);
69 void put_u64(uint64_t p_val);
70 void put_float(
float p_val);
71 void put_double(
double p_val);
72 void put_utf8_string(
const String& p_string);
73 void put_var(
const Variant& p_variant);
85 String get_string(
int p_bytes);
86 String get_utf8_string(
int p_bytes);
94 #endif // STREAM_PEER_H
virtual Error put_partial_data(const uint8_t *p_data, int p_bytes, int &r_sent)=0
put as much data as possible, without blocking.
virtual Error get_data(uint8_t *p_buffer, int p_bytes)=0
read p_bytes of data, if p_bytes > available, it will block
virtual Error get_partial_data(uint8_t *p_buffer, int p_bytes, int &r_received)=0
read as much data as p_bytes into buffer, if less was read, return in r_received
Definition: stream_peer.h:34
Definition: reference.h:40
virtual Error put_data(const uint8_t *p_data, int p_bytes)=0
put a whole chunk of data, blocking until it sent