pub async fn recv_from(&self, context: &Context) -> io::Result<(Address, Vec<u8>)> {
        let timeout = context.config().udp_timeout.unwrap_or(DEFAULT_TIMEOUT);

        // Waiting for response from server SERVER -> CLIENT
        // Packet length is limited by MAXIMUM_UDP_PAYLOAD_SIZE, excess bytes will be discarded.
        let mut recv_buf = vec![0u8; MAXIMUM_UDP_PAYLOAD_SIZE];
        let recv_n = try_timeout(self.socket.recv(&mut recv_buf), Some(timeout)).await?;
        let (addr, payload) = Self::parse_resp(context, self.method, &self.key, &recv_buf[..recv_n]).await?;
        Ok((addr, payload))
    }
/// Receive packet from Shadowsocks' UDP server
Receive packet from Shadowsocks' UDP server
Receive packet from Shadowsocks ' UDP server
pub async fn recv_from(&self, context: &Context) -> io::Result<(Address, Vec<u8>)> {
        let timeout = context.config().udp_timeout.unwrap_or(DEFAULT_TIMEOUT);
        // Waiting for response from server SERVER -> CLIENT
        // Packet length is limited by MAXIMUM_UDP_PAYLOAD_SIZE, excess bytes will be discarded.
        let mut recv_buf = vec![0u8; MAXIMUM_UDP_PAYLOAD_SIZE];
        let recv_n = try_timeout(self.socket.recv(&mut recv_buf), Some(timeout)).await?;
        let (addr, payload) = Self::parse_resp(context, self.method, &self.key, &recv_buf[..recv_n]).await?;
        Ok((addr, payload))
    }
pub async fn recv_from ( & self , context : & Context ) -> io :: Result < ( Address , Vec < u8 > ) > { let timeout = context . config ( ) . udp_timeout . unwrap_or ( DEFAULT_TIMEOUT ) ; // Waiting for response from server SERVER -> CLIENT // Packet length is limited by MAXIMUM_UDP_PAYLOAD_SIZE, excess bytes will be discarded. let mut recv_buf = vec ! [ 0u8 MAXIMUM_UDP_PAYLOAD_SIZE ] ; let recv_n = try_timeout ( self . socket . recv ( & mut recv_buf ) , Some ( timeout ) ) . await ? ; let ( addr , payload ) = Self :: parse_resp ( context , self . method , & self . key , & recv_buf [ .. recv_n ] ) . await ? ; Ok ( ( addr , payload ) ) }
Receive packet from Shadowsocks' UDP server
Receive packet from Shadowsocks ' UDP server
&self
context
&Context