On Tuesday 04 March 2003 05:55 am, Yukihiro Matsumoto wrote:
> Hi,
>
> In message "TCPSocket delay problem"
>
>     on 03/03/04, Seth Kurtzberg <seth / cql.com> writes:
> |Any suggestions on how to work around this?
>
> How about using octet decimal e.g.
>
>   TCPSocket.open("192.168.0.1", port)

The dotted address is not available.  That's what DNS lookups are for, to 
translate the symbolic name to an IP address.

>
> or consult your sysadmin to set up proper /etc/resolv.conf,
> /etc/nsswitch.conf, etc. ?

Please read my questions before responding with that sort of answer.  I'm not 
an idiot.

My system is not set up incorrectly.  The names resolve properly using the dig 
command, or in programs other than Ruby.  And, in fact, for most names, Ruby 
has no problem.

The problem only occurs with names that do not resolve.  These particular 
names are returned as part of an http document; when used in an http 
retrieval operation they result in an HTTP redirection.

Again there is no delay when used in a tool or in programs in other languages.  
Most likely this difference occurs because these other tools and programs 
don't use the getaddrinfo() call.

By the way, I tried to use the replacement getaddrinfo() call that is provided 
for systems that don't have getaddrinfo(), however, (1) compilation fails 
because a method signature is different (compared to that in netdb.h).  When 
I force the compilation, a link error occurs.

>
> 							matz.

-- 
Seth Kurtzberg
M. I. S. Corp.
480-661-1849
seth / cql.com