pub async fn send_to(&self, context: &Context, addr: &Address, payload: &[u8]) -> io::Result<()> {
        trace!(
            "UDP server client send to {}, payload length {} bytes",
            addr,
            payload.len()
        );

        let timeout = context.config().udp_timeout.unwrap_or(DEFAULT_TIMEOUT);

        let send_buf = Self::pack_req(self.method, &self.key, context, addr, payload).await?;

        let send_len = try_timeout(self.socket.send(&send_buf), Some(timeout)).await?;
        if send_buf.len() != send_len {
            warn!(
                "UDP server client send {} bytes, but actually sent {} bytes",
                send_buf.len(),
                send_len
            );
        }

        Ok(())
    }
/// Send a UDP packet to addr through proxy
Send a UDP packet to addr through proxy
Send a UDP packet to addr through proxy
pub async fn send_to(&self, context: &Context, addr: &Address, payload: &[u8]) -> io::Result<()> {
        trace!(
            "UDP server client send to {}, payload length {} bytes",
            addr,
            payload.len()
        );
        let timeout = context.config().udp_timeout.unwrap_or(DEFAULT_TIMEOUT);
        let send_buf = Self::pack_req(self.method, &self.key, context, addr, payload).await?;
        let send_len = try_timeout(self.socket.send(&send_buf), Some(timeout)).await?;
        if send_buf.len() != send_len {
            warn!(
                "UDP server client send {} bytes, but actually sent {} bytes",
                send_buf.len(),
                send_len
            );
        }
        Ok(())
    }
pub async fn send_to ( & self , context : & Context , addr : & Address , payload : & [ u8 ] ) -> io :: Result < ( ) > { trace ! ( " " addr payload len ( ) ) ; let timeout = context . config ( ) . udp_timeout . unwrap_or ( DEFAULT_TIMEOUT ) ; let send_buf = Self :: pack_req ( self . method , & self . key , context , addr , payload ) . await ? ; let send_len = try_timeout ( self . socket . send ( & send_buf ) , Some ( timeout ) ) . await ? ; if send_buf . len ( ) != send_len { warn ! ( " " send_buf len ( ) send_len ) ; } Ok ( ( ) ) }
Send a UDP packet to addr through proxy
Send a UDP packet to addr through proxy
&self
context
&Context
addr
&Address
payload
&[u8]