Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::netio::NetworkLoop::Tasks::AddTcpServerPort Class Reference

Add TCP server port. More...

#include <network_loop.h>

Inheritance diagram for roc::netio::NetworkLoop::Tasks::AddTcpServerPort:
Collaboration diagram for roc::netio::NetworkLoop::Tasks::AddTcpServerPort:

Public Member Functions

 AddTcpServerPort (TcpServerConfig &config, IConnAcceptor &conn_acceptor)
 Set task parameters. More...
 
PortHandle get_handle () const
 Get created port handle. More...
 
- Public Member Functions inherited from roc::netio::NetworkTask
bool success () const
 Check that the task finished and succeeded. More...
 
- Public Member Functions inherited from roc::core::MpscQueueNode
MpscQueueDatampsc_queue_data () const
 Get list node data. More...
 

Friends

class NetworkLoop
 

Additional Inherited Members

- Protected Types inherited from roc::netio::NetworkTask
enum  State {
  StateInitialized , StatePending , StateClosingPort , StateFinishing ,
  StateFinished
}
 Task state. More...
 
- Protected Attributes inherited from roc::netio::NetworkTask
void(NetworkLoop::* func_ )(NetworkTask &)
 Task implementation method. More...
 
core::Atomic< int > state_
 Task state, defines whether task is finished already. The task becomes immutable after setting state to Finished. More...
 
core::Atomic< int > success_
 Task result, defines wether finished task succeeded or failed. Makes sense only after setting state_ to Finished. This atomic should be assigned before setting state_ to Finished. More...
 
core::SharedPtr< BasicPortport_
 On which port the task operates. More...
 
void * port_handle_
 Port handle. More...
 
INetworkTaskCompletercompleter_
 Completion handler. More...
 
core::Optional< core::Semaphoresem_
 Completion semaphore. More...
 

Detailed Description

Add TCP server port.

Definition at line 112 of file network_loop.h.

Constructor & Destructor Documentation

◆ AddTcpServerPort()

roc::netio::NetworkLoop::Tasks::AddTcpServerPort::AddTcpServerPort ( TcpServerConfig config,
IConnAcceptor conn_acceptor 
)

Set task parameters.

Remarks
  • Updates config with the actual bind address.
  • Listens for incoming connections and passes new connections to conn_acceptor. It should return handler that will be notified when connection state changes.

Member Function Documentation

◆ get_handle()

PortHandle roc::netio::NetworkLoop::Tasks::AddTcpServerPort::get_handle ( ) const

Get created port handle.

Precondition
Should be called only if success() is true.

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