pub fn send_to(&mut self, buf: &[u8], target: &SocketAddr) -> io::Result<usize> {
        if let Async::NotReady = self.io.poll_write() {
            return Err(io::ErrorKind::WouldBlock.into())
        }

        match self.io.get_ref().send_to(buf, target) {
            Ok(n) => Ok(n),
            Err(e) => {
                if e.kind() == io::ErrorKind::WouldBlock {
                    self.io.need_write()?;
                }
                Err(e)
            }
        }
    }
/// Sends data on the socket to the given address. On success, returns the
/// number of bytes written.
///
/// Address type can be any implementer of `ToSocketAddrs` trait. See its
/// documentation for concrete examples.
///
/// # Panics
///
/// This function will panic if called outside the context of a future's
/// task.
Sends data on the socket to the given address. On success, returns the
number of bytes written.

Address type can be any implementer of `ToSocketAddrs` trait. See its
documentation for concrete examples.
Sends data on the socket to the given address . On success returns the number of bytes written . Address type can be any implementer of ` ToSocketAddrs ` trait . See its documentation for concrete examples .
pub fn send_to(&mut self, buf: &[u8], target: &SocketAddr) -> io::Result<usize> {
        if let Async::NotReady = self.io.poll_write() {
            return Err(io::ErrorKind::WouldBlock.into())
        }
        match self.io.get_ref().send_to(buf, target) {
            Ok(n) => Ok(n),
            Err(e) => {
                if e.kind() == io::ErrorKind::WouldBlock {
                    self.io.need_write()?;
                }
                Err(e)
            }
        }
    }
pub fn send_to ( & mut self , buf : & [ u8 ] , target : & SocketAddr ) -> io :: Result < usize > { if let Async :: NotReady = self . io . poll_write ( ) { return Err ( io :: ErrorKind :: WouldBlock . into ( ) ) } match self . io . get_ref ( ) . send_to ( buf , target ) { Ok ( n ) => Ok ( n ) , Err ( e ) => { if e . kind ( ) == io :: ErrorKind :: WouldBlock { self . io . need_write ( ) ? ; } Err ( e ) } } }
Sends data on the socket to the given address.
Sends data on the socket to the given address .
&mut self
buf
&[u8]
target
&SocketAddr
&mut self
buf
&[u8]
target
&SocketAddr
panics
This function will panic if called outside the context of a future's
task.
This function will panic if called outside the context of a future ' s task .