Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Network event loop thread. More...
#include <network_loop.h>
Classes | |
class | Tasks |
Subclasses for specific tasks. More... | |
Public Types | |
typedef struct PortHandle * | PortHandle |
Opaque port handle. More... | |
Public Member Functions | |
NetworkLoop (core::IPool &packet_pool, core::IPool &buffer_pool, core::IArena &arena) | |
Initialize. More... | |
virtual | ~NetworkLoop () |
Destroy. Stop all receivers and senders. More... | |
bool | is_valid () const |
Check if the object was successfully constructed. More... | |
size_t | num_ports () const |
Get number of receiver and sender ports. More... | |
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. More... | |
ROC_ATTR_NODISCARD 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. More... | |
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.
ROC_ATTR_NODISCARD 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.