![]() |
Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Network event loop thread. More...
#include <roc_netio/target_libuv/roc_netio/network_loop.h>

Classes | |
| class | Tasks |
| Subclasses for specific tasks. More... | |
Public Types | |
| typedef struct PortHandle * | PortHandle |
| Opaque port handle. | |
Public Member Functions | |
| NetworkLoop (core::IPool &packet_pool, core::IPool &buffer_pool, core::IArena &arena) | |
| Initialize. | |
| virtual | ~NetworkLoop () |
| Destroy. Stop all receivers and senders. | |
| bool | is_valid () const |
| Check if the object was successfully constructed. | |
| size_t | num_ports () const |
| Get number of receiver and sender ports. | |
| void | schedule (NetworkTask &task, INetworkTaskCompleter &completer) |
Enqueue a task for asynchronous execution and return. The task should not be destroyed until the callback is called. The completer will be invoked on event loop thread after the task completes. | |
| bool | schedule_and_wait (NetworkTask &task) |
| Enqueue a task for asynchronous execution and wait for its completion. The task should not be destroyed until this method returns. Should not be called from schedule() callback. | |
Network event loop thread.
Definition at line 49 of file network_loop.h.
| typedef struct PortHandle* roc::netio::NetworkLoop::PortHandle |
Opaque port handle.
Definition at line 55 of file network_loop.h.
| roc::netio::NetworkLoop::NetworkLoop | ( | core::IPool & | packet_pool, |
| core::IPool & | buffer_pool, | ||
| core::IArena & | arena | ||
| ) |
Initialize.
|
virtual |
Destroy. Stop all receivers and senders.
| bool roc::netio::NetworkLoop::is_valid | ( | ) | const |
Check if the object was successfully constructed.
| size_t roc::netio::NetworkLoop::num_ports | ( | ) | const |
Get number of receiver and sender ports.
| void roc::netio::NetworkLoop::schedule | ( | NetworkTask & | task, |
| INetworkTaskCompleter & | completer | ||
| ) |
Enqueue a task for asynchronous execution and return. The task should not be destroyed until the callback is called. The completer will be invoked on event loop thread after the task completes.
| bool roc::netio::NetworkLoop::schedule_and_wait | ( | NetworkTask & | task | ) |
Enqueue a task for asynchronous execution and wait for its completion. The task should not be destroyed until this method returns. Should not be called from schedule() callback.