MCPcopy Create free account
hub / github.com/chronoxor/CppServer / EchoSession

Class EchoSession

performance/ws_echo_server.cpp:17–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15using namespace CppServer::WS;
16
17class EchoSession : public WSSession
18{
19public:
20 using WSSession::WSSession;
21
22protected:
23 void onWSReceived(const void* buffer, size_t size) override
24 {
25 // Resend the message back to the client
26 SendBinaryAsync(buffer, size);
27 }
28
29 void onError(int error, const std::string& category, const std::string& message) override
30 {
31 std::cout << "WebSocket session caught an error with code " << error << " and category '" << category << "': " << message << std::endl;
32 }
33};
34
35class EchoServer : public WSServer
36{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected