Roger Pack wrote:
> 
>>> Try your code with
>>> BasicSocket.do_not_reverse_lookup=true
>> 
>> Three observations:
>> 
>> a) I do not think that there can be a DNS lookup between a 'select(x, y, 
>> z)' and a 'socket.recvfrom'.
> 
> It might, see 
> http://www.ensta.fr/~diam/ruby/online/ruby-doc-stdlib/libdoc/socket/rdoc/classes/Socket.html#M001258
> 

Roger,

   It is stunning to think that a 'recvfrom' on a socket (done after the 
'select' signaled that there data ready to be read in the queue for that 
socket) might go off doing reverse dns queries (instead of just 
returning the packet).
Also, I did not see anything pointing to this in the link you provided 
(I read the whole page and the only place where it mentions 'reverse dns 
queries' is when issuing 'gethostbyname').

But it is true that we cannot trust anything nowadays, and it does not 
harm to include a line to avoid reverse dns queries. I did (at socket 
creation).

We are not running any more the experiment where this problem occurred, 
so I cannot say now if this fixed it. But thanks for the tip.

Raul Parolari
raulparolari / gmail.com



-- 
Posted via http://www.ruby-forum.com/.