Struct TcpSocketManager

Source
pub struct TcpSocketManager { /* private fields */ }

Implementations§

Source§

impl TcpSocketManager

Source

pub fn local_addr(&self) -> SocketAddr

Source§

impl TcpSocketManager

Source

pub async fn multi_connect( &self, addr: SocketAddr, index_offset: usize, ) -> Result<RouteKey>

Multiple connections can be initiated to the target address.

Source

pub async fn connect(&self, addr: SocketAddr) -> Result<RouteKey>

Initiate a connection.

Source

pub async fn connect_ttl( &self, addr: SocketAddr, ttl: Option<u8>, ) -> Result<RouteKey>

Source

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.

Source

pub async fn connect_reuse_port_raw( &self, addr: SocketAddr, ) -> Result<TcpStream>

Source§

impl TcpSocketManager

Source

pub async fn multi_send_to<A: Into<SocketAddr>>( &self, buf: BytesMut, addr: A, ) -> Result<()>

Source

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.

Source

pub async fn send_to<D: ToRouteKeyForTcp<()>>( &self, buf: BytesMut, dest: D, ) -> Result<()>

Writing buf to the target denoted by route_key

Source

pub async fn send_to_addr<D: Into<SocketAddr>>( &self, buf: BytesMut, dest: D, ) -> Result<()>

Source

pub fn try_send_to<D: ToRouteKeyForTcp<()>>( &self, buf: BytesMut, dest: D, ) -> Result<()>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> FromRef<T> for U
where T: Clone, U: From<T>,

Source§

fn from_ref(val_ref: &T) -> U

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V