Initialisation

All internal actions of the netio3 library are executed as events on an event loop. See the for details of the netio3::BaseEventLoop. A shared pointer to the event loop is passed to the constructors of all the netio3 send/receive/publish/subscribe classes so first instantiate the event loop.

#include <netio3-backend/EventLoop/EpollEventLoop.hpp>
...
auto  evloop = std::make_shared<EpollEventLoop>();
std::thread ev_thread([&](){evloop->run();});

The event loop is usually run in its own thread as shown above but may be run in the main program thread, passing a callback function to do the initialisation.