|
From: | Elias Mårtenson |
Subject: | Re: Asynchronous DNS |
Date: | Sat, 23 Jan 2016 22:56:38 +0800 |
I see four ways of implementing an async name resolution function:
1) Add a new `resolve-name' function that would fork Emacs, call
getaddrinfo/gethostbyname, and do a callback once we get a reply. The
problem is that a forked Emacs is a very strange thing, and is not
something we otherwise do. I looked at this for a day last time, and I
couldn't get it to work, really. Perhaps somebody else could, though.
2) Use one of the newer async C resolver libraries. This would not be
available on all platforms, and would be Yet Another Dependency which
I'm sure everybody would rather that we avoid.
3) Create a tiny helper program in lib-src that would read names from
stdin and output resolves on stdout. It would use
getaddrinfo/gethostbyname, and could very well be multithreaded, so that
it could do name resolution on parallel.
4) Pick the data out of res_init to find the DNS servers, and then just
use dns.el for name resolution. This would be trivial to implement, but
may not respect the name resolutions settings on some operating systems.
[Prev in Thread] | Current Thread | [Next in Thread] |