Based on this asynchronous daytime server example from the Boost-Asio documentation.
Example use:
try
{
boost::asio::io_context io_context;
AsyncDaytimeServer s(io_context);
s.start();
io_context.run();
}
catch (std::exception& e)
{
std::cerr << e.what() << std::endl;
}
Example tested with this daytime client example from the Boost-Asio documentation, using localhost
and private IP
.