Support for pluggable resolvers
A resolver maps several kinds of names to addresses, or vice versa. Currently, only DNS host lookups are supported (but this can be extended if needed).
The plugin mechanism allows one to change the name resovler Ocamlnet
uses. Resolvers can be both synchronous or asynchronous. Note however,
that the default resolver is synchronous and simply bases on
Requirements of the resolver:
The following types are the same as in [root:Uq_engines], here only redefined for systematic reasons
This host cannot be resolved
The type of resolvers:
Look up the passed host name up. The implementation can be synchronous
or asynchronous. In the first case, an engine is returned that is
already in one of the states
`Done he or
`Error e where
the host entry, or
e is an exception like
Host_not_found. In this
case the passed event system is ignored. If the implementation is
asynchronous, the caller must run the event system until the
state of the engine transitions to
`Done he or
The default resolver uses
Unix.gethostbyname to look up names.
Note that this usually means that no IPv6 addresses are returned.
This resolver uses
Unix.getaddrinfo. One can set whether IPv4
or IPv6 addresses may be returned (only one type is returned).
The order of addresses cannot
be set, but there is a global config file
h_aliases field of the result is not set.
By default, both
ipv6 are enabled.