From adamiaonr at gmail.com Sun Jul 31 21:04:18 2016 From: adamiaonr at gmail.com (=?UTF-8?Q?Dami=C3=A3o_Rodrigues?=) Date: Sun, 31 Jul 2016 23:04:18 +0200 Subject: [ldns-users] Are there send() and recv()-like interfaces in libdns? Message-ID: I've built a simple command line application in C which uses libdns to make periodic DNS queries to the authoritative name servers of multiple domains. Ensuring the periodicity of the queries is important, following a user-defined query_interval (in seconds). As far as I could tell, libdns only allows for request-response calls: the functions which start DNS queries also return the DNS response, blocking until a response is received. Because of this, I've implemented a key part of the application in a naive way within a while() cycle: 1. I do a block of queries 2. Take note of the time taken by the query block (query_time) 3. sleep(query_interval - query_time) 4. Go back to 1 I think this is sloppy. A better option would be to have separate send/receive threads. This way, the periodicity of the query blocks wouldn't be affected by the duration of the request-response cycles. But for that I would need libdns functions with separate send()- and recv()-like interfaces, which I couldn't find in the documentation, greps in the source folders, nor examples. Have I missed something? *Are there send()- and recv()-like interfaces in libdns?* Thanks in advance! Best regards, Antonio -------------- next part -------------- An HTML attachment was scrubbed... URL: