As the subject line says, I'd like an asychronous gethostbyaddr(). I've got
a program that receives a number of TCP socket connects, and currently I can't
use gethostbyaddr() in that program because it blocks (sometimes for quite a
while on sites in other continents) I don't know much about the resolver(3)
calls, but they appear as though they block until a response is received just
like gethostbyaddr().
Does anyone have code that will do this? All I want is a name to an address,
or to know there is no name for that address that can be found. I need to
have a socket (either UDP or TCP, doesn't matter to me) in my program so that
I know when this information arrives and I can get the hostname information I
need out of it. I do know that nameserver calls associate an ID of sorts with
each calls, so I can keep track of that and receive my information out of
order.
As a last resort, I could get some libc source and roll my own, but surely
*someone* *somewhere* has invented this particular wheel before? (I hope!)
Thanks for any code/help/examples/leads anyone can provide.
--
/--------------------------------------------------------------------------
| Doug Siebert | "I don't have to take this abuse |
| ICBM: 41d 39m 55s N, 91d 30m 43s W | me!" Bill Murray, Ghostbusters |
\--------------------------------------------------------------------------