pub async fn bind(bind_addr: &ManagerAddr, context: &Context) -> io::Result<ManagerDatagram> {
        match *bind_addr {
            ManagerAddr::SocketAddr(ref saddr) => Ok(ManagerDatagram::UdpDatagram(create_udp_socket(saddr).await?)),
            ManagerAddr::DomainName(ref dname, port) => {
                let (_, socket) =
                    lookup_then!(context, dname, port, false, |saddr| { create_udp_socket(&saddr).await })?;

                Ok(ManagerDatagram::UdpDatagram(socket))
            }
            #[cfg(unix)]
            ManagerAddr::UnixSocketAddr(ref path) => {
                use std::fs;

                // Remove it first incase it is already exists
                let _ = fs::remove_file(path);

                Ok(ManagerDatagram::UnixDatagram(UnixDatagram::bind(path)?))
            }
        }
    }
/// Create a `ManagerDatagram` binding to requested `bind_addr`
Create a `ManagerDatagram` binding to requested `bind_addr`
Create a ` ManagerDatagram ` binding to requested ` bind_addr `
pub async fn bind(bind_addr: &ManagerAddr, context: &Context) -> io::Result<ManagerDatagram> {
        match *bind_addr {
            ManagerAddr::SocketAddr(ref saddr) => Ok(ManagerDatagram::UdpDatagram(create_udp_socket(saddr).await?)),
            ManagerAddr::DomainName(ref dname, port) => {
                let (_, socket) =
                    lookup_then!(context, dname, port, false, |saddr| { create_udp_socket(&saddr).await })?;
                Ok(ManagerDatagram::UdpDatagram(socket))
            }
            #[cfg(unix)]
            ManagerAddr::UnixSocketAddr(ref path) => {
                use std::fs;
                // Remove it first incase it is already exists
                let _ = fs::remove_file(path);
                Ok(ManagerDatagram::UnixDatagram(UnixDatagram::bind(path)?))
            }
        }
    }
pub async fn bind ( bind_addr : & ManagerAddr , context : & Context ) -> io :: Result < ManagerDatagram > { match * bind_addr { ManagerAddr :: SocketAddr ( ref saddr ) => Ok ( ManagerDatagram :: UdpDatagram ( create_udp_socket ( saddr ) . await ? ) ) , ManagerAddr :: DomainName ( ref dname , port ) => { let ( _ , socket ) = lookup_then ! ( context dname port false saddr { create_udp_socket ( saddr ) await } ) ? ; Ok ( ManagerDatagram :: UdpDatagram ( socket ) ) } # [ cfg ( unix ) ] ManagerAddr :: UnixSocketAddr ( ref path ) => { use std :: fs ; // Remove it first incase it is already exists let _ = fs :: remove_file ( path ) ; Ok ( ManagerDatagram :: UnixDatagram ( UnixDatagram :: bind ( path ) ? ) ) } } }
Create a `ManagerDatagram` binding to requested `bind_addr`
Create a ` ManagerDatagram ` binding to requested ` bind_addr `
bind_addr
&ManagerAddr
context
&Context
bind_addr
&ManagerAddr
context
&Context