Struct shadowsocks_service::net::mon_socket::MonProxySocket [−][src]
Monitored ProxySocket
Implementations
impl MonProxySocket
[src]
pub fn from_socket(
socket: ProxySocket,
flow_stat: Arc<FlowStat>
) -> MonProxySocket
[src]
socket: ProxySocket,
flow_stat: Arc<FlowStat>
) -> MonProxySocket
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]
&self,
target: A,
addr: &Address,
payload: &[u8]
) -> Result<()>
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]
&self,
recv_buf: &mut [u8]
) -> Result<(usize, SocketAddr, Address)>
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
impl !RefUnwindSafe for MonProxySocket
impl Send for MonProxySocket
impl Sync for MonProxySocket
impl Unpin for MonProxySocket
impl !UnwindSafe for MonProxySocket
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> UnsafeAny for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,