2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
20#ifndef WEB_WEBSOCKET_SERVER_SUBSPROTOCOL_H
21#define WEB_WEBSOCKET_SERVER_SUBSPROTOCOL_H
23#include "web/websocket/SubProtocol.h"
26 class SocketContextUpgrade;
31#ifndef DOXYGEN_SHOULD_SKIP_THIS
46 SubProtocol(
SubProtocolContext* subProtocolContext,
const std::string& name,
int pingInterval = 0,
int maxFlyingPings = 3);
60 void subscribe(
const std::string& group);
62 void sendBroadcast(
const char* message, std::size_t messageLength,
bool excludeSelf =
false);
63 void sendBroadcast(
const std::string& message,
bool excludeSelf =
false);
65 void sendBroadcastStart(
const char* message, std::size_t messageLength,
bool excludeSelf =
false);
66 void sendBroadcastStart(
const std::string& message,
bool excludeSelf =
false);
68 void sendBroadcastFrame(
const char* message, std::size_t messageLength,
bool excludeSelf =
false);
69 void sendBroadcastFrame(
const std::string& message,
bool excludeSelf =
false);
71 void sendBroadcastEnd(
const char* message, std::size_t messageLength,
bool excludeSelf =
false);
72 void sendBroadcastEnd(
const std::string& message,
bool excludeSelf =
false);
79 template <
typename RequestT,
typename ResponseT,
typename SubProtocolT>
bool onSignal(int sig) override
Echo(web::websocket::SubProtocolContext *socketContextUpgradeBase, const std::string &name)
void onDisconnected() override
void onMessageError(uint16_t errnum) override
void onMessageStart(int opCode) override
void onMessageData(const char *chunk, std::size_t chunkLen) override
void onMessageEnd() override
void onConnected() override
friend class web::websocket::SocketContextUpgrade
void forEachClient(const std::function< void(const SubProtocol *)> &sendToClient, bool excludeSelf=false)
void sendBroadcastFrame(const char *message, std::size_t messageLength, bool excludeSelf=false)
void sendBroadcast(const char *message, std::size_t messageLength, bool excludeSelf=false)
void sendBroadcastStart(const char *message, std::size_t messageLength, bool excludeSelf=false)
void sendBroadcastEnd(const char *message, std::size_t messageLength, bool excludeSelf=false)