Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::netio::UdpPort Class Reference

UDP sender/receiver port. More...

#include <udp_port.h>

Inheritance diagram for roc::netio::UdpPort:
Collaboration diagram for roc::netio::UdpPort:

Public Member Functions

 UdpPort (const UdpConfig &config, uv_loop_t &event_loop, packet::PacketFactory &packet_factory, core::IArena &arena)
 Initialize. More...
 
virtual ~UdpPort ()
 Destroy. More...
 
const address::SocketAddrbind_address () const
 Get bind address. More...
 
virtual bool open ()
 Open receiver. More...
 
virtual AsyncOperationStatus async_close (ICloseHandler &handler, void *handler_arg)
 Asynchronously close receiver. More...
 
packet::IWriterstart_send ()
 Start receiving packets. More...
 
bool start_recv (packet::IWriter &inbound_writer)
 Start receiving packets. More...
 
- Public Member Functions inherited from roc::netio::BasicPort
 BasicPort (core::IArena &)
 Initialize. More...
 
virtual ~BasicPort ()
 Destroy. More...
 
const char * descriptor () const
 Get a human-readable port description. More...
 
- Public Member Functions inherited from roc::core::RefCounted< BasicPort, core::ArenaAllocation >
 RefCounted ()
 Initialize. More...
 
 RefCounted (const core::ArenaAllocation &policy)
 Initialize. More...
 
int getref () const
 Get reference counter. More...
 
void incref () const
 Increment reference counter. More...
 
void decref () const
 Decrement reference counter. More...
 
- Public Member Functions inherited from roc::core::ListNode< Tag >
ListDatalist_data () const
 Get pointer to internal data. More...
 

Protected Member Functions

virtual void format_descriptor (core::StringBuilder &b)
 Format descriptor. More...
 
- Protected Member Functions inherited from roc::netio::BasicPort
void update_descriptor ()
 Format descriptor and store into internal buffer. More...
 
- Protected Member Functions inherited from roc::core::ArenaAllocation
IArenaarena () const
 Get arena. More...
 
 ArenaAllocation (IArena &arena)
 Initialize. More...
 
template<class T >
void destroy (T &object)
 Destroy object and return memory to arena. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from roc::core::ListNode< Tag >
static ListNodelist_node (ListData *data)
 Get pointer to parent node from pointer to internal data. More...
 

Detailed Description

UDP sender/receiver port.

Definition at line 70 of file udp_port.h.

Constructor & Destructor Documentation

◆ UdpPort()

roc::netio::UdpPort::UdpPort ( const UdpConfig config,
uv_loop_t &  event_loop,
packet::PacketFactory packet_factory,
core::IArena arena 
)

Initialize.

◆ ~UdpPort()

virtual roc::netio::UdpPort::~UdpPort ( )
virtual

Destroy.

Member Function Documentation

◆ async_close()

virtual AsyncOperationStatus roc::netio::UdpPort::async_close ( ICloseHandler handler,
void *  handler_arg 
)
virtual

Asynchronously close receiver.

Implements roc::netio::BasicPort.

◆ bind_address()

const address::SocketAddr& roc::netio::UdpPort::bind_address ( ) const

Get bind address.

◆ format_descriptor()

virtual void roc::netio::UdpPort::format_descriptor ( core::StringBuilder b)
protectedvirtual

Format descriptor.

Implements roc::netio::BasicPort.

◆ open()

virtual bool roc::netio::UdpPort::open ( )
virtual

Open receiver.

Implements roc::netio::BasicPort.

◆ start_recv()

bool roc::netio::UdpPort::start_recv ( packet::IWriter inbound_writer)

Start receiving packets.

Remarks
Received packets will be written to inbound_writer. Writer will be invoked from network thread.

◆ start_send()

packet::IWriter* roc::netio::UdpPort::start_send ( )

Start receiving packets.

Remarks
Packets written to returned writer will be enqueued for sending. Writer can be used from any thread.

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