Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Connection interface. More...
#include <iconn.h>
Public Member Functions | |
virtual const address::SocketAddr & | local_address () const =0 |
Return address of the local peer. More... | |
virtual const address::SocketAddr & | remote_address () const =0 |
Return address of the remote peer. More... | |
virtual bool | is_failed () const =0 |
Return true if there was a failure. More... | |
virtual bool | is_writable () const =0 |
Return true if the connection is writable. More... | |
virtual bool | is_readable () const =0 |
Return true if the connection is readable. More... | |
virtual ssize_t | try_write (const void *buf, size_t len)=0 |
Try writing buf of size len to the connection without blocking. More... | |
virtual ssize_t | try_read (void *buf, size_t len)=0 |
Try reading len bytes from the the connection to buf without blocking. More... | |
virtual void | async_terminate (TerminationMode mode)=0 |
Initiate asynchronous connection termination. More... | |
Connection interface.
All methods are thread-safe and non-blocking.
All methods are also lock-free if there is no more than one simultaneous writer or reader. IConn operations are never blocked by network thread itself, but concurrent simultaneous writes and reads block each other.
|
pure virtual |
Initiate asynchronous connection termination.
Implemented in roc::netio::TcpConnectionPort.
|
pure virtual |
Return true if there was a failure.
Implemented in roc::netio::TcpConnectionPort.
|
pure virtual |
Return true if the connection is readable.
Implemented in roc::netio::TcpConnectionPort.
|
pure virtual |
Return true if the connection is writable.
Implemented in roc::netio::TcpConnectionPort.
|
pure virtual |
Return address of the local peer.
Implemented in roc::netio::TcpConnectionPort.
|
pure virtual |
Return address of the remote peer.
Implemented in roc::netio::TcpConnectionPort.
|
pure virtual |
Try reading len
bytes from the the connection to buf
without blocking.
buf
should not be NULL.buf
should have size at least of len
bytes. Implemented in roc::netio::TcpConnectionPort.
|
pure virtual |
Try writing buf
of size len
to the connection without blocking.
buf
should not be NULL.buf
should have size at least of len
bytes. Implemented in roc::netio::TcpConnectionPort.