version 1.199, 2006/08/03 03:34:42 |
version 1.199.4.1, 2006/11/08 00:42:11 |
|
|
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); |