I'm trying to create a C++ daemon that is capable of asynchronously sending/receiving requests/responses as packets over the network. It should communicate with clients (outwards-facing message API) and other daemons (inter-server messages)
I'm currently looking at boost::asio
, specifically http://www.boost.org/doc/libs/1_65_1/doc/html/boost_asio/tutorial/tutdaytime6/src.html as a starting point that seems to be running a server capable of handling async. send and receive.
My question is, could this server be run alongside (in the background) a command loop, such as a process responding to user input (e.g. shell)? The daytime server program provided seems to block on the line io_service.run();
Would this require a forked or separate threaded server?