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

Class EchoSession

performance/ssl_echo_server.cpp:16–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected