| 15 | using namespace CppServer::WS; |
| 16 | |
| 17 | class EchoSession : public WSSession |
| 18 | { |
| 19 | public: |
| 20 | using WSSession::WSSession; |
| 21 | |
| 22 | protected: |
| 23 | void onWSReceived(const void* buffer, size_t size) override |
| 24 | { |
| 25 | // Resend the message back to the client |
| 26 | SendBinaryAsync(buffer, size); |
| 27 | } |
| 28 | |
| 29 | void onError(int error, const std::string& category, const std::string& message) override |
| 30 | { |
| 31 | std::cout << "WebSocket session caught an error with code " << error << " and category '" << category << "': " << message << std::endl; |
| 32 | } |
| 33 | }; |
| 34 | |
| 35 | class EchoServer : public WSServer |
| 36 | { |
nothing calls this directly
no outgoing calls
no test coverage detected