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

Method onWSReceived

examples/ws_chat_server.cpp:35–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33 }
34
35 void onWSReceived(const void* buffer, size_t size) override
36 {
37 std::string message((const char*)buffer, size);
38 std::cout << "Incoming: " << message << std::endl;
39
40 // Multicast message to all connected sessions
41 std::dynamic_pointer_cast<CppServer::WS::WSServer>(server())->MulticastText(message);
42
43 // If the buffer starts with '!' the disconnect the current session
44 if (message == "!")
45 Close();
46 }
47
48 void onError(int error, const std::string& category, const std::string& message) override
49 {

Callers

nothing calls this directly

Calls 1

MulticastTextMethod · 0.45

Tested by

no test coverage detected