Runs the completion of network operations: received datagrams, finished sends.
Definition context.hpp:23
NetworkContext(NetworkContext &&)=delete
void stop() noexcept
Makes run(), run_for() and poll() return as soon as possible. Thread-safe.
NetworkContext & operator=(NetworkContext &&)=delete
NetworkContext(const NetworkContext &)=delete
void run()
Runs handlers until stop() is called, waiting when nothing is ready.
NetworkContext & operator=(const NetworkContext &)=delete
std::size_t poll()
Runs the handlers that are ready, without waiting.
~NetworkContext()
Destroys the context; handlers not run yet are dropped.
std::size_t run_for(std::chrono::milliseconds duration)
Runs handlers as they become ready, for at most duration.