Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
websocketpp::frame::opcode Namespace Reference

Constants and utility functions related to WebSocket opcodes. More...

Enumerations

enum  value {
  continuation = 0x0 , text = 0x1 , binary = 0x2 , rsv3 = 0x3 ,
  rsv4 = 0x4 , rsv5 = 0x5 , rsv6 = 0x6 , rsv7 = 0x7 ,
  close = 0x8 , ping = 0x9 , pong = 0xA , control_rsvb = 0xB ,
  control_rsvc = 0xC , control_rsvd = 0xD , control_rsve = 0xE , control_rsvf = 0xF ,
  CONTINUATION = 0x0 , TEXT = 0x1 , BINARY = 0x2 , RSV3 = 0x3 ,
  RSV4 = 0x4 , RSV5 = 0x5 , RSV6 = 0x6 , RSV7 = 0x7 ,
  CLOSE = 0x8 , PING = 0x9 , PONG = 0xA , CONTROL_RSVB = 0xB ,
  CONTROL_RSVC = 0xC , CONTROL_RSVD = 0xD , CONTROL_RSVE = 0xE , CONTROL_RSVF = 0xF
}
 

Functions

bool reserved (value v)
 Check if an opcode is reserved.
 
bool invalid (value v)
 Check if an opcode is invalid.
 
bool is_control (value v)
 Check if an opcode is for a control frame.
 

Detailed Description

WebSocket Opcodes are 4 bits. See RFC6455 section 5.2.

Enumeration Type Documentation

◆ value

Enumerator
continuation 
text 
binary 
rsv3 
rsv4 
rsv5 
rsv6 
rsv7 
close 
ping 
pong 
control_rsvb 
control_rsvc 
control_rsvd 
control_rsve 
control_rsvf 
CONTINUATION 
TEXT 
BINARY 
RSV3 
RSV4 
RSV5 
RSV6 
RSV7 
CLOSE 
PING 
PONG 
CONTROL_RSVB 
CONTROL_RSVC 
CONTROL_RSVD 
CONTROL_RSVE 
CONTROL_RSVF 

Definition at line 77 of file frame.hpp.

77 {
78 continuation = 0x0,
79 text = 0x1,
80 binary = 0x2,
81 rsv3 = 0x3,
82 rsv4 = 0x4,
83 rsv5 = 0x5,
84 rsv6 = 0x6,
85 rsv7 = 0x7,
86 close = 0x8,
87 ping = 0x9,
88 pong = 0xA,
89 control_rsvb = 0xB,
90 control_rsvc = 0xC,
91 control_rsvd = 0xD,
92 control_rsve = 0xE,
93 control_rsvf = 0xF,
94
95 CONTINUATION = 0x0,
96 TEXT = 0x1,
97 BINARY = 0x2,
98 RSV3 = 0x3,
99 RSV4 = 0x4,
100 RSV5 = 0x5,
101 RSV6 = 0x6,
102 RSV7 = 0x7,
103 CLOSE = 0x8,
104 PING = 0x9,
105 PONG = 0xA,
106 CONTROL_RSVB = 0xB,
107 CONTROL_RSVC = 0xC,
108 CONTROL_RSVD = 0xD,
109 CONTROL_RSVE = 0xE,
110 CONTROL_RSVF = 0xF
111 };
#define BINARY(operandTypeId, resultTypeId)
void close(T *e, websocketpp::connection_hdl hdl)

Function Documentation

◆ invalid()

bool websocketpp::frame::opcode::invalid ( value v)
inline

Invalid opcodes are negative or require greater than 4 bits to store.

Parameters
vThe opcode to test.
Returns
Whether or not the opcode is invalid.

Definition at line 130 of file frame.hpp.

130 {
131 return (v > 0xF || v < 0);
132 }
Here is the caller graph for this function:

◆ is_control()

bool websocketpp::frame::opcode::is_control ( value v)
inline
Parameters
vThe opcode to test.
Returns
Whether or not the opcode is a control opcode.

Definition at line 139 of file frame.hpp.

139 {
140 return v >= 0x8;
141 }
Here is the caller graph for this function:

◆ reserved()

bool websocketpp::frame::opcode::reserved ( value v)
inline
Parameters
vThe opcode to test.
Returns
Whether or not the opcode is reserved.

Definition at line 118 of file frame.hpp.

118 {
119 return (v >= rsv3 && v <= rsv7) ||
120 (v >= control_rsvb && v <= control_rsvf);
121 }
Here is the caller graph for this function: