ntpq peers formatting needs floating point for time slots.
Gary E. Miller
gem at rellim.com
Mon Apr 24 16:56:00 UTC 2017
Yo Ian!
On Mon, 24 Apr 2017 10:35:25 -0500
Ian Bruene <ianbruene at 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
gem at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20170424/c58f90ac/attachment.bin>
More information about the devel
mailing list