Re: connect(2) behavior with unreacheable hosts

From: <BelletJr_at_aol.com>
Date: Fri, 11 Apr 2003 13:14:15 EDT
>Dans un e-mail daté du 11/04/03 00:23:16 Paris, Madrid (Heure d'été), 
tlambert2_at_mindspring.com a écrit :
>
>BelletJr_at_aol.com wrote:
>> Why does not connect(2) return any error when trying to connect to a host
>> unreachable because of an infinite loop in the routes? No time-out occurs 
and
>> the value 0 is returned by connect(2).
>> My test was done with TCP/IPv4.
>
>Because it can't detect an infinite routing loop.

Then why can't it detect an infinite routing loop? :) It does not implement 
the classic three-way handshake of a TCP connection establishment??

If this is the case, I think the man page is not precise enough. It states 
"If the socket is of type SOCK_STREAM, this call attempts to make a 
connection to another socket" and later on "The connect() function returns 
the value 0 if successful".

BTW we can imagine that the majority of programs aren't crafted to handle 
this case. Have a look for example to the simple "daytime.c" program from the 
developper handbook. It just doesn't do anything if time.nist.gov is 
unreachable because of an infinite routing loop.

Jerome
Received on Fri Apr 11 2003 - 08:14:25 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:03 UTC