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
44#ifndef DOXYGEN_SHOULD_SKIP_THIS
46#include "log/Logger.h"
47#include "utils/system/signal.h"
53#define MAX_FLYING_PINGS 3
54#define PING_INTERVAL 90
56namespace apps::websocket::subprotocol::echo::
client {
63 VLOG(1) <<
"Echo connected";
67 VLOG(2) <<
"Message Start - OpCode: " << opCode;
71 data += std::string(chunk, chunkLen);
73 VLOG(2) <<
"Message Fragment: " << std::string(chunk, chunkLen);
77 VLOG(1) <<
"Message Full Data: " <<
data;
78 VLOG(1) <<
"Message End";
80
81
82
83
90 VLOG(1) <<
"Message error: " << errnum;
94 VLOG(1) <<
"Echo disconnected:";
98 VLOG(1) <<
"SubProtocol 'echo' exit due to '" << strsignal(sig) <<
"' (SIG" << utils
::system::sigabbrev_np(sig
) <<
" = " << sig
bool onSignal(int sig) override
void onMessageEnd() override
Echo(web::websocket::SubProtocolContext *socketContextUpgradeBase, const std::string &name)
void onDisconnected() override
void onConnected() override
void onMessageStart(int opCode) override
void onMessageError(uint16_t errnum) override
void onMessageData(const char *chunk, std::size_t chunkLen) override
void sendClose(uint16_t statusCode=1000, const char *reason=nullptr, std::size_t reasonLength=0)
std::string sigabbrev_np(int sig)