ServerApp demo program

This commit is contained in:
2025-01-20 11:28:07 -05:00
parent a0c0ccdf5e
commit 4d7e8d2fc8

View File

@@ -27,11 +27,18 @@ int main(int argc, char** argv) {
{
std::cout << ipv4 << ":" << port << " =>" << message << "(" << length << ")" << std::endl;
if (message == "ping")
{
udpServer.SendTo("ping", ipv4, port);
return;
}
udpServer.SendTo(message, length, ipv4, port);
};
// Bind the server to a port.
udpServer.Bind(8888, [](int errorCode, std::string errorMessage) {
udpServer.Bind(42069, [](int errorCode, std::string errorMessage) {
std::cout << errorCode << ":" << errorMessage << std::endl;
});