Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
websocketpp::frame::basic_header Struct Reference

The constant size component of a WebSocket frame header. More...

#include <frame.hpp>

Public Member Functions

 basic_header ()
 
 basic_header (uint8_t p0, uint8_t p1)
 
 basic_header (opcode::value op, uint64_t size, bool fin, bool mask, bool rsv1=false, bool rsv2=false, bool rsv3=false)
 

Public Attributes

uint8_t b0
 
uint8_t b1
 

Detailed Description

Definition at line 189 of file frame.hpp.

Constructor & Destructor Documentation

◆ basic_header() [1/3]

websocketpp::frame::basic_header::basic_header ( )
inline

Definition at line 190 of file frame.hpp.

◆ basic_header() [2/3]

websocketpp::frame::basic_header::basic_header ( uint8_t p0,
uint8_t p1 )
inline

Definition at line 192 of file frame.hpp.

192: b0(p0), b1(p1) {}

◆ basic_header() [3/3]

websocketpp::frame::basic_header::basic_header ( opcode::value op,
uint64_t size,
bool fin,
bool mask,
bool rsv1 = false,
bool rsv2 = false,
bool rsv3 = false )
inline

Definition at line 194 of file frame.hpp.

195 : b0(0x00),
196 b1(0x00)
197 {
198 if (fin) {
199 b0 |= BHB0_FIN;
200 }
201 if (rsv1) {
202 b0 |= BHB0_RSV1;
203 }
204 if (rsv2) {
205 b0 |= BHB0_RSV2;
206 }
207 if (rsv3) {
208 b0 |= BHB0_RSV3;
209 }
210 b0 |= (op & BHB0_OPCODE);
211
212 if (mask) {
213 b1 |= BHB1_MASK;
214 }
215
216 uint8_t basic_value;
217
218 if (size <= limits::payload_size_basic) {
219 basic_value = static_cast<uint8_t>(size);
220 } else if (size <= limits::payload_size_extended) {
221 basic_value = payload_size_code_16bit;
222 } else {
223 basic_value = payload_size_code_64bit;
224 }
225
226
227 b1 |= basic_value;
228 }
unsigned char uint8_t
Definition stdint.h:124

Member Data Documentation

◆ b0

uint8_t websocketpp::frame::basic_header::b0

Definition at line 230 of file frame.hpp.

◆ b1

uint8_t websocketpp::frame::basic_header::b1

Definition at line 231 of file frame.hpp.


The documentation for this struct was generated from the following file: