version 1.168.2.2, 2006/10/06 03:19:33 |
version 1.168.2.3, 2006/11/08 00:44:05 |
|
|
gai_strerror(gaierr)); |
gai_strerror(gaierr)); |
|
|
for (attempt = 0; attempt < connection_attempts; attempt++) { |
for (attempt = 0; attempt < connection_attempts; attempt++) { |
if (attempt > 0) |
if (attempt > 0) { |
|
/* Sleep a moment before retrying. */ |
|
sleep(1); |
debug("Trying again..."); |
debug("Trying again..."); |
|
} |
/* |
/* |
* Loop through addresses for this host, and try each one in |
* Loop through addresses for this host, and try each one in |
* sequence until the connection succeeds. |
* sequence until the connection succeeds. |
|
|
} |
} |
if (sock != -1) |
if (sock != -1) |
break; /* Successful connection. */ |
break; /* Successful connection. */ |
|
|
/* Sleep a moment before retrying. */ |
|
sleep(1); |
|
} |
} |
|
|
freeaddrinfo(aitop); |
freeaddrinfo(aitop); |