getaddrinfo(host,
port,
family=None,
socktype=1,
proto=0,
allow_cname=True)
| source code
|
Resolve host and port into addrinfo struct.
Does the same thing as socket.getaddrinfo, but using dns.resolver ,
so the cache content from the SRV query can be used.
- Parameters:
host (: unicode or str ) - : service domain name.
port (: int or str ) - : service port number or name.
family (: int ) - : address family (AF_INET for IPv4, AF_INET6 for IPv6 or
AF_UNSPEC for either, None for the auto-configured default).
socktype (: int ) - : socket type.
proto (: int or str ) - : protocol number or name.
allow_cname (: bool ) - : when False CNAME responses are not allowed.
- Returns:
list of (int , int , int , str , (str , int ))
- list of (family, socktype, proto, canonname, sockaddr).
|