12 #ifndef ROC_NETIO_ICONN_H_
13 #define ROC_NETIO_ICONN_H_
55 virtual ssize_t
try_write(
const void* buf,
size_t len) = 0;
63 virtual ssize_t
try_read(
void* buf,
size_t len) = 0;
virtual bool is_writable() const =0
Return true if the connection is writable.
virtual bool is_readable() const =0
Return true if the connection is readable.
virtual ssize_t try_write(const void *buf, size_t len)=0
Try writing buf of size len to the connection without blocking.
virtual const address::SocketAddr & local_address() const =0
Return address of the local peer.
virtual const address::SocketAddr & remote_address() const =0
Return address of the remote peer.
virtual ssize_t try_read(void *buf, size_t len)=0
Try reading len bytes from the the connection to buf without blocking.
virtual void async_terminate(TerminationMode mode)=0
Initiate asynchronous connection termination.
virtual bool is_failed() const =0
Return true if there was a failure.
TerminationMode
Connection termination mode.
Commonly used types and functions.
Connection termination mode.