fastdo
0.6.8
|
WebSocket封装 更多...
类 | |
struct | CloseFramePayloadData |
struct | FrameBase |
WS帧基类 更多... | |
struct | FrameBasic |
struct | FrameBasicMasked |
struct | FrameExtended16 |
struct | FrameExtended16Masked |
struct | FrameExtended64 |
struct | FrameExtended64Masked |
struct | WebSocketWrapper |
WebSocket场景包装 更多... | |
class | WsHttpClientCtx |
WsHTTP客户场景 更多... | |
class | WsHttpServer |
WsHTTP服务端 更多... | |
枚举 | |
enum | OpCode : winux::uint { dataContinued = 0x0U, dataText = 0x1U, dataBinary = 0x2U, dataRsv3 = 0x3U, dataRsv4 = 0x4U, dataRsv5 = 0x5U, dataRsv6 = 0x6U, dataRsv7 = 0x7U, ctrlClose = 0x8U, ctrlPing = 0x9U, ctrlPong = 0xAU, ctrlRsvB = 0xBU, ctrlRsvC = 0xCU, ctrlRsvD = 0xDU, ctrlRsvE = 0xEU, ctrlRsvF = 0xFU } |
操作码 更多... | |
enum | WebSocketErrorCode { errNothing, errCnnUnexpectedInvalid } |
WebSocket错误码 更多... | |
enum | FrameType { ftBasic = 0b0010, ftBasicMasked = 0b0011, ftExtended16 = 0b0100, ftExtended16Masked = 0b0101, ftExtended64 = 0b1000, ftExtended64Masked = 0b1001 } |
数据帧类型 更多... | |
enum | ReadyState { stateConnecting, stateOpen, stateClosing, stateClosed } |
就绪状态 更多... | |
函数 | |
bool | SendWebSocketFrame (eiennet::Socket *sock, OpCode opcode, bool fin, bool mask, winux::byte *payloadData=nullptr, size_t payloadDataSize=0) |
bool | SendWebSocketBuffer (eiennet::Socket *sock, OpCode opcode, bool mask, winux::Buffer payloadData=winux::Buffer(), size_t perFrameMaxPayloadSize=-1) |
bool | SendWebSocketAnsi (eiennet::Socket *sock, OpCode opcode, bool mask, winux::AnsiString payloadData=winux::AnsiString(), size_t perFrameMaxPayloadSize=-1) |
WebSocket封装
数据帧类型
枚举值 | |
---|---|
ftBasic | |
ftBasicMasked | |
ftExtended16 | |
ftExtended16Masked | |
ftExtended64 | |
ftExtended64Masked |
在文件 eiennet_websocket.hpp 第 90 行定义.
操作码
-> 32 bits 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 -> 4 bytes 0 1 2 3 bit order 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 +-+-+-+-+-——+-+-------——+-------------------------——+ |F|R|R|R| opcode|M| Payload len | Extended payload length | |I|S|S|S| (4) |A| (7) | (16/64) | |N|V|V|V| |S| | (if payload len==126/127) | | |1|2|3| |K| | | +-+-+-+-+-——+-+-------——+ - - - - - - - - - - - - - - - + | Extended payload length continued, if payload len == 127 |
在文件 eiennet_websocket.hpp 第 61 行定义.
bool eiennet::old_v1::ws::SendWebSocketAnsi | ( | eiennet::Socket * | sock, |
OpCode | opcode, | ||
bool | mask, | ||
winux::AnsiString | payloadData = winux::AnsiString() , |
||
size_t | perFrameMaxPayloadSize = -1 |
||
) |
bool eiennet::old_v1::ws::SendWebSocketBuffer | ( | eiennet::Socket * | sock, |
OpCode | opcode, | ||
bool | mask, | ||
winux::Buffer | payloadData = winux::Buffer() , |
||
size_t | perFrameMaxPayloadSize = -1 |
||
) |
bool eiennet::old_v1::ws::SendWebSocketFrame | ( | eiennet::Socket * | sock, |
OpCode | opcode, | ||
bool | fin, | ||
bool | mask, | ||
winux::byte * | payloadData = nullptr , |
||
size_t | payloadDataSize = 0 |
||
) |