[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaSocket - non-blocking connect ? (fwd)
- From: Diego Nehab <diego@...>
- Date: Sun, 31 May 2009 20:59:25 -0400 (EDT)
Yes, the DNS lookup can do that. What does an async DNS
library look like?
It's a non-blocking wrapper around a fixed and hacked up version
of dns.lua. A nice C replacement regularly features in our
The catch is that we need to look up SRV records and need a reasonable
timeout, which the standard Linux resolver doesn't appear capable of.
So there is a Lua implementation of gethostbyname that does
It seems as though you should have no
trouble replacing the DNS lookup in LuaSocket with something
else, without any changes to C code.
Oh so the DNS lookup is performed from inside LuaSocket? That greatly
simplifies things, thanks.
I don't know what you mean by the question. LuaSocket has
two DNS facilities. One is when you invoke
socket.dns.toip(). The other is when you invoke connect()
with a domain name. Both cases and up invoking
What I meant is that if you have a Lua replacement of
gethostbyname, you can do your own translation and pass the
ip as a string to the non-blocking connect().