Struct mtcp_rs::TcpManager
source · pub struct TcpManager { /* private fields */ }
Expand description
A manager for “shared” resources, used by
mtcp::TcpListener
and
mtcp::TcpStream
The same mtcp::TcpManager
instance can be shared by multiple
mtcp::TcpListener
and mtcp::TcpStream
instances. However, an
mtcp::TcpManager
instance can not be shared across the thread
boundary: Each thread needs to create its own mtcp::TcpManager
instance.
A thread-local singleton instance can be obtained via the
instance()
function.
The canceller()
function can be used to obtain
a new mtcp::TcpCanceller
instance for this
mtcp::TcpManager
.