nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
websocket.h File Reference
#include <cstddef>
#include <cstdint>
#include <optional>
#include <string>
#include <string_view>
#include "absl/status/status.h"
#include "absl/status/statusor.h"

Go to the source code of this file.

Classes

struct  nanommo::Handshake
 What a client's opening handshake asks for. More...
struct  nanommo::Message
 A whole message, or a ping, a pong or a close. More...
class  nanommo::FrameDecoder

Namespaces

namespace  nanommo

Enumerations

enum class  nanommo::Opcode : uint8_t {
  nanommo::kContinuation = 0x0 , nanommo::kText = 0x1 , nanommo::kBinary = 0x2 , nanommo::kClose = 0x8 ,
  nanommo::kPing = 0x9 , nanommo::kPong = 0xA
}

Functions

absl::StatusOr< Handshake > nanommo::ParseHandshake (std::string_view request)
std::string nanommo::AcceptKey (std::string_view key)
std::string nanommo::Accept (std::string_view key)
 The server's answer that switches the connection over to WebSocket.
std::string nanommo::Refuse (int status, std::string_view why)
 An HTTP answer that turns the connection down, with why in its body.
std::string nanommo::ServerFrame (Opcode opcode, std::string_view payload)
 A frame as the server sends it: whole, and never masked.
std::string nanommo::ClientFrame (Opcode opcode, std::string_view payload, uint32_t mask, bool fin)