Struct mtcp_rs::TcpConnection
source · pub struct TcpConnection { /* private fields */ }
Expand description
A pending incoming TCP connection, usually used to initialize a new
mtcp_rs::TcpStream
Unlike an mtcp_rs::TcpStream
instance, the mtcp_rs::TcpConnection
instance is not yet tied to a
mtcp_rs::TcpManager
instance and can therefore
safely be moved across the thread boundary.
Implementations§
source§impl TcpConnection
impl TcpConnection
sourcepub fn peer_addr(&self) -> Option<SocketAddr>
pub fn peer_addr(&self) -> Option<SocketAddr>
Get the peer socket address of this TCP connection.
sourcepub fn local_addr(&self) -> Option<SocketAddr>
pub fn local_addr(&self) -> Option<SocketAddr>
Get the local socket address of this TCP connection.