ServerApp demo program
This commit is contained in:
@@ -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;
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user