Struct shadowsocks_service::net::mon_socket::MonProxySocket[][src]

pub struct MonProxySocket { /* fields omitted */ }

Monitored ProxySocket

Implementations

impl MonProxySocket[src]

pub fn from_socket(
    socket: ProxySocket,
    flow_stat: Arc<FlowStat>
) -> MonProxySocket
[src]

Create a new socket with flow monitor

pub async fn send(&self, addr: &Address, payload: &[u8]) -> Result<()>[src]

Send a UDP packet to addr through proxy

pub async fn send_to<A: ToSocketAddrs>(
    &self,
    target: A,
    addr: &Address,
    payload: &[u8]
) -> Result<()>
[src]

Send a UDP packet to target from proxy

pub async fn recv(&self, recv_buf: &mut [u8]) -> Result<(usize, Address)>[src]

Receive packet from Shadowsocks’ UDP server

This function will use recv_buf to store intermediate data, so it has to be big enough to store the whole shadowsocks’ packet

It is recommended to allocate a buffer to have at least 65536 bytes.

pub async fn recv_from(
    &self,
    recv_buf: &mut [u8]
) -> Result<(usize, SocketAddr, Address)>
[src]

Receive packet from Shadowsocks’ UDP server

This function will use recv_buf to store intermediate data, so it has to be big enough to store the whole shadowsocks’ packet

It is recommended to allocate a buffer to have at least 65536 bytes.

pub fn get_ref(&self) -> &ProxySocket[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> UnsafeAny for T where
    T: Any

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