Comparison

net/dns.lua @ 3049:e54774bd73a7

net/dns: Fix socket.select timeout.
author Brian Cully <bjc@junctionnetworks.com>
date Mon, 28 Dec 2009 19:49:55 +0500
parent 2742:6c0a081cd766
child 3056:c585678b3ecb
comparison
equal deleted inserted replaced
3047:820ae39e06de 3049:e54774bd73a7
849 end 849 end
850 850
851 851
852 function resolver:lookup(qname, qtype, qclass) -- - - - - - - - - - lookup 852 function resolver:lookup(qname, qtype, qclass) -- - - - - - - - - - lookup
853 self:query (qname, qtype, qclass) 853 self:query (qname, qtype, qclass)
854 while self:pulse() do socket.select(self.socket, nil, 4); end 854 while self:pulse() do
855 local recvt = {}
856 local i, s
857 for i, s in ipairs(self.socket) do
858 recvt[i] = s.socket()
859 end
860 socket.select(recvt, nil, 4)
861 end
855 --print(self.cache); 862 --print(self.cache);
856 return self:peek(qname, qtype, qclass); 863 return self:peek(qname, qtype, qclass);
857 end 864 end
858 865
859 function resolver:lookupex(handler, qname, qtype, qclass) -- - - - - - - - - - lookup 866 function resolver:lookupex(handler, qname, qtype, qclass) -- - - - - - - - - - lookup