Symbian platform (C++)
SDK native APIs, runtime and tooling
Loading...
Searching...
No Matches
symbian::websocket::internal Namespace Reference

Classes

class  Framing
 

Functions

void AppendBigEndian16 (std::string *output, std::uint16_t value)
 
void AppendBigEndian64 (std::string *output, std::uint64_t value)
 
void MaskInPlace (char *data, size_t length, const char(&mask)[4])
 XORs length bytes at data with a repeating 4-byte WebSocket mask.
 
std::uint16_t ReadBigEndian16 (std::string_view input, size_t offset)
 
std::uint64_t ReadBigEndian64 (std::string_view input, size_t offset)
 

Variables

constexpr std::uint8_t kContinuation = 0x0
 
constexpr std::uint8_t kText = 0x1
 
constexpr std::uint8_t kBinary = 0x2
 
constexpr std::uint8_t kClose = 0x8
 
constexpr std::uint8_t kPing = 0x9
 
constexpr std::uint8_t kPong = 0xa
 

Function Documentation

◆ AppendBigEndian16()

void symbian::websocket::internal::AppendBigEndian16 ( std::string *  output,
std::uint16_t  value 
)

◆ AppendBigEndian64()

void symbian::websocket::internal::AppendBigEndian64 ( std::string *  output,
std::uint64_t  value 
)

◆ MaskInPlace()

void symbian::websocket::internal::MaskInPlace ( char *  data,
size_t  length,
const char(&)  mask[4] 
)

XORs length bytes at data with a repeating 4-byte WebSocket mask.

A word at a time, because this runs over every byte a client sends and every byte a server receives: RFC 6455 masking is not optional and not negotiable. The obvious data[i] ^= mask[i % 4] costs a division per byte and defeats vectorisation, which at 64 KiB per message is a real fraction of the message's whole cost. Reading the mask as one 32-bit word and XORing word-wise leaves the compiler free to widen it further.

Always from the start of the mask, which is all RFC 6455 needs: every frame carries its own masking key and applies it from its own first payload byte, so a fragmented message's continuations do not continue the previous frame's mask.

◆ ReadBigEndian16()

std::uint16_t symbian::websocket::internal::ReadBigEndian16 ( std::string_view  input,
size_t  offset 
)

◆ ReadBigEndian64()

std::uint64_t symbian::websocket::internal::ReadBigEndian64 ( std::string_view  input,
size_t  offset 
)

Variable Documentation

◆ kBinary

constexpr std::uint8_t symbian::websocket::internal::kBinary = 0x2
constexpr

◆ kClose

constexpr std::uint8_t symbian::websocket::internal::kClose = 0x8
constexpr

◆ kContinuation

constexpr std::uint8_t symbian::websocket::internal::kContinuation = 0x0
constexpr

◆ kPing

constexpr std::uint8_t symbian::websocket::internal::kPing = 0x9
constexpr

◆ kPong

constexpr std::uint8_t symbian::websocket::internal::kPong = 0xa
constexpr

◆ kText

constexpr std::uint8_t symbian::websocket::internal::kText = 0x1
constexpr