Open
Description
The socket docs state:
The native socket address format of the socket module is an opaque data type returned by getaddrinfo function, which must be used to resolve textual address (including numeric addresses).
The example script re-iterates this:
You must use getaddrinfo() even for numeric addresses
This would seem to have a number of consequences.
- On some ports async
getaddrinfo
may need to provide this opaque data. In every case I've seen the synchronousgetaddrinfo
returns a dotted quad, but the docs are specific on this. A query to @dpgeorge may be needed to resolve this. - Async
getaddrinfr
needs to handle dotted quads as input. Currently it fails if passed a dotted quad. Thenetwork
module does this here. - If async
getaddrinfo
is to follow this rule it must use syncgetaddrinfo
which is absurd. This may be another reason to use the network's own DNS server.
The reason for point 2 is as follows. An application (such as async MQTT) reads a config file containing a network address. This is either a dotted quad for a local server or a domain name for a server on the internet. Currently it calls getaddrinfo
with the passed address and uses the opaque result to connect.