nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
nanommo::FrameDecoder Class Reference

#include <websocket.h>

Public Member Functions

 FrameDecoder (std::size_t max_message)
 A message larger than this, all its fragments together, is refused.
void Append (std::string_view bytes)
std::optional< Message > Next ()
const absl::Status & status () const

Detailed Description

Reads a client's frames, which each have to be masked, and puts each message together from its fragments. Control frames (ping, pong and close) come out as they arrive, between a message's fragments too.

Definition at line 66 of file websocket.h.

Constructor & Destructor Documentation

◆ FrameDecoder()

nanommo::FrameDecoder::FrameDecoder ( std::size_t max_message)
inlineexplicit

A message larger than this, all its fragments together, is refused.

Definition at line 69 of file websocket.h.

Member Function Documentation

◆ Append()

void nanommo::FrameDecoder::Append ( std::string_view bytes)

Definition at line 170 of file websocket.cc.

◆ Next()

std::optional< Message > nanommo::FrameDecoder::Next ( )

The next message, or nothing until more bytes come. After a frame that breaks the protocol, returns nothing more, and status() says why.

Definition at line 183 of file websocket.cc.

◆ status()

const absl::Status & nanommo::FrameDecoder::status ( ) const
inline

Definition at line 77 of file websocket.h.


The documentation for this class was generated from the following files: