-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
Description
I believe the current mechanism used for hostname lookups interferes with truly asynchronous networking. The async dial() ends up using the getaddrinfo() C library call, which can show serious blocking behaviour.
This is a common problem in network programming, with no obvious solutions, but it would be nice to offer a truly async experience for the Nim user without unexpected blocking when doing high level networking, like AsyncHttpClient.
Some ideas:
- Can Nim wrap the getaddrinfo() call in a separate thread to do the lookups? This requires threading to be enabled, obviously
- Should Nim implement (a subset of) getaddrinfo() asynchronously in pure Nim?
- Should Nim be able to rely on an external library for lookups, like libc-ares?
FedericoCeratto and ikyrre