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

Method onReceived

examples/udp_echo_server.cpp:27–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25 }
26
27 void onReceived(const asio::ip::udp::endpoint& endpoint, const void* buffer, size_t size) override
28 {
29 std::string message((const char*)buffer, size);
30 std::cout << "Incoming: " << message << std::endl;
31
32 // Echo the message back to the sender
33 SendAsync(endpoint, message);
34 }
35
36 void onSent(const asio::ip::udp::endpoint& endpoint, size_t sent) override
37 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected