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

Method onReceived

examples/ssl_chat_server.cpp:40–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38 }
39
40 void onReceived(const void* buffer, size_t size) override
41 {
42 std::string message((const char*)buffer, size);
43 std::cout << "Incoming: " << message << std::endl;
44
45 // Multicast message to all connected sessions
46 server()->Multicast(message);
47
48 // If the buffer starts with '!' the disconnect the current session
49 if (message == "!")
50 Disconnect();
51 }
52
53 void onError(int error, const std::string& category, const std::string& message) override
54 {

Callers

nothing calls this directly

Calls 1

MulticastMethod · 0.45

Tested by

no test coverage detected