pub struct TcpSocketManager { /* private fields */ }
Implementations§
Source§impl TcpSocketManager
impl TcpSocketManager
pub fn local_addr(&self) -> SocketAddr
Source§impl TcpSocketManager
impl TcpSocketManager
Sourcepub async fn multi_connect(
&self,
addr: SocketAddr,
index_offset: usize,
) -> Result<RouteKey>
pub async fn multi_connect( &self, addr: SocketAddr, index_offset: usize, ) -> Result<RouteKey>
Multiple connections can be initiated to the target address.
Sourcepub async fn connect(&self, addr: SocketAddr) -> Result<RouteKey>
pub async fn connect(&self, addr: SocketAddr) -> Result<RouteKey>
Initiate a connection.
pub async fn connect_ttl( &self, addr: SocketAddr, ttl: Option<u8>, ) -> Result<RouteKey>
Sourcepub async fn connect_reuse_port(&self, addr: SocketAddr) -> Result<RouteKey>
pub async fn connect_reuse_port(&self, addr: SocketAddr) -> Result<RouteKey>
Reuse the bound port to initiate a connection, which can be used to penetrate NAT1 network type.
pub async fn connect_reuse_port_raw( &self, addr: SocketAddr, ) -> Result<TcpStream>
Source§impl TcpSocketManager
impl TcpSocketManager
pub async fn multi_send_to<A: Into<SocketAddr>>( &self, buf: BytesMut, addr: A, ) -> Result<()>
Sourcepub async fn reuse_port_send_to<A: Into<SocketAddr>>(
&self,
buf: BytesMut,
addr: A,
) -> Result<()>
pub async fn reuse_port_send_to<A: Into<SocketAddr>>( &self, buf: BytesMut, addr: A, ) -> Result<()>
Reuse the bound port to initiate a connection, which can be used to penetrate NAT1 network type.
Sourcepub async fn send_to<D: ToRouteKeyForTcp<()>>(
&self,
buf: BytesMut,
dest: D,
) -> Result<()>
pub async fn send_to<D: ToRouteKeyForTcp<()>>( &self, buf: BytesMut, dest: D, ) -> Result<()>
Writing buf
to the target denoted by route_key
pub async fn send_to_addr<D: Into<SocketAddr>>( &self, buf: BytesMut, dest: D, ) -> Result<()>
pub fn try_send_to<D: ToRouteKeyForTcp<()>>( &self, buf: BytesMut, dest: D, ) -> Result<()>
Auto Trait Implementations§
impl Freeze for TcpSocketManager
impl !RefUnwindSafe for TcpSocketManager
impl Send for TcpSocketManager
impl Sync for TcpSocketManager
impl Unpin for TcpSocketManager
impl !UnwindSafe for TcpSocketManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more