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 synchronous getaddrinfo 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. The network module does this here.
- If async
getaddrinfo is to follow this rule it must use sync getaddrinfo 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.
The socket docs state:
The example script re-iterates this:
This would seem to have a number of consequences.
getaddrinfomay need to provide this opaque data. In every case I've seen the synchronousgetaddrinforeturns a dotted quad, but the docs are specific on this. A query to @dpgeorge may be needed to resolve this.getaddrinfrneeds to handle dotted quads as input. Currently it fails if passed a dotted quad. Thenetworkmodule does this here.getaddrinfois to follow this rule it must use syncgetaddrinfowhich 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
getaddrinfowith the passed address and uses the opaque result to connect.