MCPcopy Create free account
hub / github.com/chronoxor/CppServer / EchoUDPClient

Class EchoUDPClient

tests/test_udp.cpp:42–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40};
41
42class EchoUDPClient : public UDPClient
43{
44public:
45 using UDPClient::UDPClient;
46
47protected:
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
53public:
54 std::atomic<bool> connected{false};
55 std::atomic<bool> disconnected{false};
56 std::atomic<bool> errors{false};
57};
58
59class EchoUDPServer : public UDPServer
60{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected