Skip to content

raisim::server::websocket::FrameDecoder ​

class · #include <raisim/server/WebSocket.hpp>

Decodes what a client sends: masked frames whose binary messages may come in fragments, with control frames between them.

Public types ​

Status ​

cpp
enum class Status
Enumerator
kOk
kClosed
kError

Constructors & destructor ​

FrameDecoder ​

cpp
explicit FrameDecoder(uint64_t maxMessageBytes)

Public member functions ​

feed ​

cpp
Status feed(
    const uint8_t *bytes,
    size_t size,
    std::vector<char> &data,
    std::vector<std::string> &pings)

Consumes bytes, appending message payload to data and each ping's payload to pings, which the server must answer with pongs. After a close frame or a protocol violation it returns kClosed or kError, and the connection is over.

status ​

cpp
Status status() const

RaiSim — physics for robotics and AI.