2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
42#ifndef WEB_WEBSOCKET_SERVER_SUBSPROTOCOL_H
43#define WEB_WEBSOCKET_SERVER_SUBSPROTOCOL_H
45#include "web/websocket/SubProtocol.h"
53#ifndef DOXYGEN_SHOULD_SKIP_THIS
74 using Super::sendMessage;
76 using Super::sendMessageEnd;
77 using Super::sendMessageFrame;
78 using Super::sendMessageStart;
80 using Super::sendClose;
84 void sendBroadcast(
const char* message, std::size_t messageLength,
bool excludeSelf =
false);
85 void sendBroadcast(
const std::string& message,
bool excludeSelf =
false);
87 void sendBroadcastStart(
const char* message, std::size_t messageLength,
bool excludeSelf =
false);
90 void sendBroadcastFrame(
const char* message, std::size_t messageLength,
bool excludeSelf =
false);
93 void sendBroadcastEnd(
const char* message, std::size_t messageLength,
bool excludeSelf =
false);
101 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
void sendMessage(const std::string &message) const
void sendClose(uint16_t statusCode=1000, const char *reason=nullptr, std::size_t reasonLength=0)
friend class web::websocket::SocketContextUpgrade
void sendBroadcastEnd(const std::string &message, bool excludeSelf=false)
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 sendBroadcastFrame(const std::string &message, 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 sendBroadcastStart(const std::string &message, bool excludeSelf=false)
SubProtocol(SubProtocolContext *subProtocolContext, const std::string &name, int pingInterval=0, int maxFlyingPings=3)
void sendBroadcastEnd(const char *message, std::size_t messageLength, bool excludeSelf=false)
void subscribe(const std::string &group)
void sendBroadcast(const std::string &message, bool excludeSelf=false)
std::string sigabbrev_np(int sig)