| 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 | { |
nothing calls this directly
no test coverage detected