Chops Net IP
Loading...
Searching...
No Matches
chops::net::worker Class Reference

Convenience class that combines an executor work guard and a thread, invoking asynchronous operations as per the Asio documentation. More...

#include <worker.hpp>

Public Member Functions

asio::io_context & get_io_context ()
 Provide access to the io_context.
 
void start ()
 Start the thread that invokes the underlying asynchronous operations.
 
void stop ()
 Shutdown the executor and join the thread, abandoning any outstanding operations or handlers.
 
void reset ()
 Reset the internal work guard and join the thread, waiting for outstanding operations or handlers to complete.
 

Detailed Description

Convenience class that combines an executor work guard and a thread, invoking asynchronous operations as per the Asio documentation.

Note
This class is not a necessary dependency of the net_ip library, but is provided for convenience in many use cases.

Member Function Documentation

◆ get_io_context()

asio::io_context & chops::net::worker::get_io_context ( )
inline

Provide access to the io_context.

Returns
Reference to a asio::io_context.

The documentation for this class was generated from the following file: