| 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 | { |