pub async fn send_to_manager(&mut self, buf: &[u8], context: &Context, target: &ManagerAddr) -> io::Result<usize> {
        match *self {
            ManagerDatagram::UdpDatagram(ref mut udp) => match *target {
                ManagerAddr::SocketAddr(ref saddr) => udp.send_to(buf, saddr).await,
                ManagerAddr::DomainName(ref dname, port) => {
                    let (_, n) = lookup_then!(context, dname, port, false, |saddr| { udp.send_to(buf, saddr).await })?;
                    Ok(n)
                }
                #[cfg(unix)]
                ManagerAddr::UnixSocketAddr(..) => {
                    let err = Error::new(ErrorKind::InvalidInput, "udp datagram requires IP address target");
                    Err(err)
                }
            },
            #[cfg(unix)]
            ManagerDatagram::UnixDatagram(ref mut unix) => match *target {
                ManagerAddr::UnixSocketAddr(ref paddr) => unix.send_to(buf, paddr).await,
                ManagerAddr::SocketAddr(..) | ManagerAddr::DomainName(..) => {
                    let err = Error::new(ErrorKind::InvalidInput, "unix datagram requires path address target");
                    Err(err)
                }
            },
        }
    }
/// Sends data on the socket to the specified manager address
Sends data on the socket to the specified manager address
Sends data on the socket to the specified manager address
pub async fn send_to_manager(&mut self, buf: &[u8], context: &Context, target: &ManagerAddr) -> io::Result<usize> {
        match *self {
            ManagerDatagram::UdpDatagram(ref mut udp) => match *target {
                ManagerAddr::SocketAddr(ref saddr) => udp.send_to(buf, saddr).await,
                ManagerAddr::DomainName(ref dname, port) => {
                    let (_, n) = lookup_then!(context, dname, port, false, |saddr| { udp.send_to(buf, saddr).await })?;
                    Ok(n)
                }
                #[cfg(unix)]
                ManagerAddr::UnixSocketAddr(..) => {
                    let err = Error::new(ErrorKind::InvalidInput, "udp datagram requires IP address target");
                    Err(err)
                }
            },
            #[cfg(unix)]
            ManagerDatagram::UnixDatagram(ref mut unix) => match *target {
                ManagerAddr::UnixSocketAddr(ref paddr) => unix.send_to(buf, paddr).await,
                ManagerAddr::SocketAddr(..) | ManagerAddr::DomainName(..) => {
                    let err = Error::new(ErrorKind::InvalidInput, "unix datagram requires path address target");
                    Err(err)
                }
            },
        }
    }
pub async fn send_to_manager ( & mut self , buf : & [ u8 ] , context : & Context , target : & ManagerAddr ) -> io :: Result < usize > { match * self { ManagerDatagram :: UdpDatagram ( ref mut udp ) => match * target { ManagerAddr :: SocketAddr ( ref saddr ) => udp . send_to ( buf , saddr ) . await , ManagerAddr :: DomainName ( ref dname , port ) => { let ( _ , n ) = lookup_then ! ( context dname port false saddr { udp send_to ( buf saddr ) await } ) ? ; Ok ( n ) } # [ cfg ( unix ) ] ManagerAddr :: UnixSocketAddr ( .. ) => { let err = Error :: new ( ErrorKind :: InvalidInput , " " ) ; Err ( err ) } } , # [ cfg ( unix ) ] ManagerDatagram :: UnixDatagram ( ref mut unix ) => match * target { ManagerAddr :: UnixSocketAddr ( ref paddr ) => unix . send_to ( buf , paddr ) . await , ManagerAddr :: SocketAddr ( .. ) | ManagerAddr :: DomainName ( .. ) => { let err = Error :: new ( ErrorKind :: InvalidInput , " " ) ; Err ( err ) } } , } }
Sends data on the socket to the specified manager address
Sends data on the socket to the specified manager address
&mut self
buf
&[u8]
context
&Context
target
&ManagerAddr
&mut self
buf
&[u8]
context
&Context
target
&ManagerAddr