14 #include "../acl_cpp_define.hpp" 15 #include "../stdlib/noncopyable.hpp" 21 class aio_socket_stream;
128 websocket& set_frame_opcode(
unsigned char type);
135 websocket& set_frame_payload_len(
unsigned long long len);
142 websocket& set_frame_masking_key(
unsigned int mask);
152 bool send_frame_data(
const void* data,
size_t len);
153 bool send_frame_data(
void* data,
size_t len);
154 bool send_frame_data(
const char* str);
155 bool send_frame_data(
char* str);
164 bool send_frame_pong(
const void* data,
size_t len);
165 bool send_frame_pong(
void* data,
size_t len);
166 bool send_frame_pong(
const char* str);
167 bool send_frame_pong(
char* str);
176 bool send_frame_ping(
const void* data,
size_t len);
177 bool send_frame_ping(
void* data,
size_t len);
178 bool send_frame_ping(
const char* str);
179 bool send_frame_ping(
char* str);
232 bool read_frame_head(
void);
241 int read_frame_data(
void* buf,
size_t size);
251 bool peek_frame_head(
void);
262 int peek_frame_data(
char* buf,
size_t size);
263 int peek_frame_data(
string& buf,
size_t size);
269 bool is_head_finish(
void)
const;
328 return header_.opcode;
346 return header_.payload_len;
355 return header_.masking_key;
364 return payload_nread_;
373 unsigned long long payload_nread_;
374 unsigned long long payload_nsent_;
380 void make_frame_header(
void);
382 void update_head_2bytes(
unsigned char ch1,
unsigned ch2);
383 bool peek_head_2bytes(
void);
384 bool peek_head_len_2bytes(
void);
385 bool peek_head_len_8bytes(
void);
386 bool peek_head_masking_key(
void);
const frame_header & get_frame_header(void) const
unsigned int get_frame_masking_key(void) const
socket_stream & get_stream(void) const
unsigned long long payload_len
bool frame_is_rsv1(void) const
bool frame_is_rsv3(void) const
unsigned char get_frame_opcode(void) const
bool frame_is_rsv2(void) const
bool frame_has_mask(void) const
unsigned long long get_frame_payload_nread(void) const
unsigned long long get_frame_payload_len(void) const
bool frame_is_fin(void) const