| 40 | }; |
| 41 | |
| 42 | class EchoUDPClient : public UDPClient |
| 43 | { |
| 44 | public: |
| 45 | using UDPClient::UDPClient; |
| 46 | |
| 47 | protected: |
| 48 | void onConnected() override { connected = true; ReceiveAsync(); } |
| 49 | void onDisconnected() override { disconnected = true; } |
| 50 | void onReceived(const asio::ip::udp::endpoint& endpoint, const void* buffer, size_t size) override { ReceiveAsync(); } |
| 51 | void onError(int error, const std::string& category, const std::string& message) override { errors = true; } |
| 52 | |
| 53 | public: |
| 54 | std::atomic<bool> connected{false}; |
| 55 | std::atomic<bool> disconnected{false}; |
| 56 | std::atomic<bool> errors{false}; |
| 57 | }; |
| 58 | |
| 59 | class EchoUDPServer : public UDPServer |
| 60 | { |
nothing calls this directly
no outgoing calls
no test coverage detected