| 33 | }; |
| 34 | |
| 35 | class EchoServer : public WSServer |
| 36 | { |
| 37 | public: |
| 38 | using WSServer::WSServer; |
| 39 | |
| 40 | protected: |
| 41 | std::shared_ptr<TCPSession> CreateSession(const std::shared_ptr<TCPServer>& server) override |
| 42 | { |
| 43 | return std::make_shared<EchoSession>(std::dynamic_pointer_cast<WSServer>(server)); |
| 44 | } |
| 45 | |
| 46 | protected: |
| 47 | void onError(int error, const std::string& category, const std::string& message) override |
| 48 | { |
| 49 | std::cout << "WebSocket server caught an error with code " << error << " and category '" << category << "': " << message << std::endl; |
| 50 | } |
| 51 | }; |
| 52 | |
| 53 | int main(int argc, char** argv) |
| 54 | { |
nothing calls this directly
no outgoing calls
no test coverage detected