version 1.176.2.1, 2006/09/30 04:06:51 |
version 1.176.2.2, 2006/11/08 00:17:14 |
|
|
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); |