Yo Ian!

On Mon, 24 Apr 2017 10:35:25 -0500
Ian Bruene <ianbru...@gmail.com> wrote:

> On 04/24/2017 08:43 AM, Eric S. Raymond wrote:
> > One possible technical blocker: I don't know if async DNS lookups
> > are doable from Python.  
> 
> Doesn't look like async DNS is possible in stock Python. There is a 
> library with python bindings to do it (*another* dependency), and
> there is always the option of brute forcing the issue using a helper
> script.

Python can do 'threading'.  Look in the doc for the threading
module.  Just create a thread, have the thread do a dns lookup with
socket.gethostbyaddr(ip_address).  When the thread gets the answer it
saves it and sets a flag.

The main loop just goes about its other tasks, checking for the flag
now and then.

There will be details like having the thread timeout after a while, etc.

But prolly 50 lines of code or less.

I put 'threading' in quotes because it is not full blown concurrent
threading, just cooperative multi-taksing on a cingle core.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        g...@rellim.com  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin

Attachment: pgpdqvKVcIY8E.pgp
Description: OpenPGP digital signature

_______________________________________________
devel mailing list
devel@ntpsec.org
http://lists.ntpsec.org/mailman/listinfo/devel

Reply via email to