[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Socket.getaddrinfo and IPSocket.getaddress super slow?

Brian Candler

9/12/2008 9:06:00 PM

> Anyone know why Socket.getaddrinfo and IPSocket.getaddress take up to 3
> seconds to return when the host doesn't have a record in DNS?

They seem to do reverse DNS lookups on occasions where you might not want
them to (e.g. finding the IP address to which a socket is bound). Try adding
to the top of your program:

require 'socket'
Socket.do_not_reverse_lookup=true

1 Answer

Jeff Moore

9/12/2008 9:55:00 PM

0

Brian Candler wrote:
>> Anyone know why Socket.getaddrinfo and IPSocket.getaddress take up to 3
>> seconds to return when the host doesn't have a record in DNS?
>
> They seem to do reverse DNS lookups on occasions where you might not
> want
> them to (e.g. finding the IP address to which a socket is bound). Try
> adding
> to the top of your program:
>
> require 'socket'
> Socket.do_not_reverse_lookup=true

The Zeroconf (avahi) mDNS service seems to pretty well bone things up on
Ubuntu 7/8 as well. You might want to shut it off and see what happens
(it seems to be running by default) you're hanging out with zoo
critters.
--
Posted via http://www.ruby-....