SNode.C
Loading...
Searching...
No Matches
SubProtocol.h
Go to the documentation of this file.
1/*
2 * SNode.C - a slim toolkit for network communication
3 * Copyright (C) Volker Christian <me@vchrist.at>
4 * 2020, 2021, 2022, 2023, 2024, 2025
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published
8 * by the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef WEB_WEBSOCKET_CLIENT_SUBSPROTOCOL_H
21#define WEB_WEBSOCKET_CLIENT_SUBSPROTOCOL_H
22
23#include "web/websocket/SubProtocol.h"
24
25namespace web::websocket::client {
26 class SocketContextUpgrade;
27} // namespace web::websocket::client
28
29// IWYU pragma: no_include "web/websocket/SubProtocol.hpp"
30
31#ifndef DOXYGEN_SHOULD_SKIP_THIS
32
33#endif /* DOXYGEN_SHOULD_SKIP_THIS */
34
35namespace web::websocket::client {
36
38 private:
39 using Super = web::websocket::SubProtocol<web::websocket::client::SocketContextUpgrade>;
40
41 protected:
42 using Super::Super;
43
44 public:
46
47 /* Facade (API) to WSServerContext -> WSTransmitter to be used from SubProtocol-Subclasses */
48 using Super::sendMessage;
49
50 using Super::sendMessageEnd;
53
54 using Super::sendClose;
55
56 template <typename RequestT, typename ResponseT, typename SubProtocolT>
57 friend class web::websocket::SocketContextUpgrade;
58 };
59
60} // namespace web::websocket::client
61
62extern template class web::websocket::SubProtocol<web::websocket::client::SocketContextUpgrade>;
63
64#endif // WEB_WEBSOCKET_CLIENT_SUBSPROTOCOL_H
Echo(web::websocket::SubProtocolContext *socketContextUpgradeBase, const std::string &name)
Definition Echo.cpp:36
void onMessageStart(int opCode) override
Definition Echo.cpp:44
void onMessageError(uint16_t errnum) override
Definition Echo.cpp:67
void onMessageData(const char *chunk, std::size_t chunkLen) override
Definition Echo.cpp:48
friend class web::websocket::SocketContextUpgrade
Definition SubProtocol.h:57
#define MAX_FLYING_PINGS
Definition Echo.cpp:31
#define PING_INTERVAL
Definition Echo.cpp:32