pub fn from_hostname(hostname: &CString, port: u16) -> Result<Address, Error> {
        use enet_sys::enet_address_set_host;

        let mut addr = ENetAddress { host: 0, port };

        let res =
            unsafe { enet_address_set_host(&mut addr as *mut ENetAddress, hostname.as_ptr()) };

        if res != 0 {
            return Err(Error(res));
        }

        Ok(Address::new(
            Ipv4Addr::from(u32::from_be(addr.host)),
            addr.port,
        ))
    }
/// Create a new address from a given hostname.
Create a new address from a given hostname.
Create a new address from a given hostname .
pub fn from_hostname(hostname: &CString, port: u16) -> Result<Address, Error> {
        use enet_sys::enet_address_set_host;
        let mut addr = ENetAddress { host: 0, port };
        let res =
            unsafe { enet_address_set_host(&mut addr as *mut ENetAddress, hostname.as_ptr()) };
        if res != 0 {
            return Err(Error(res));
        }
        Ok(Address::new(
            Ipv4Addr::from(u32::from_be(addr.host)),
            addr.port,
        ))
    }
pub fn from_hostname ( hostname : & CString , port : u16 ) -> Result < Address , Error > { use enet_sys :: enet_address_set_host ; let mut addr = ENetAddress { host : 0 , port } ; let res = unsafe { enet_address_set_host ( & mut addr as * mut ENetAddress , hostname . as_ptr ( ) ) } ; if res != 0 { return Err ( Error ( res ) ) ; } Ok ( Address :: new ( Ipv4Addr :: from ( u32 :: from_be ( addr . host ) ) , addr . port , ) ) }
Create a new address from a given hostname.
Create a new address from a given hostname .
hostname
&CString
port
u16
hostname
&CString
port
u16