Commit c50858f2 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Wait 10 seconds for a client connection

parent 30f4123c
...@@ -77,7 +77,6 @@ client_thread(void *priv) ...@@ -77,7 +77,6 @@ client_thread(void *priv)
struct client *c; struct client *c;
struct vtclog *vl; struct vtclog *vl;
int fd; int fd;
int i;
unsigned u; unsigned u;
struct vsb *vsb; struct vsb *vsb;
char *p; char *p;
...@@ -99,14 +98,11 @@ client_thread(void *priv) ...@@ -99,14 +98,11 @@ client_thread(void *priv)
vtc_log(vl, 2, "Started (%u iterations)", c->repeat); vtc_log(vl, 2, "Started (%u iterations)", c->repeat);
for (u = 0; u < c->repeat; u++) { for (u = 0; u < c->repeat; u++) {
vtc_log(vl, 3, "Connect to %s", vsb_data(vsb)); vtc_log(vl, 3, "Connect to %s", vsb_data(vsb));
fd = VSS_open(vsb_data(vsb), 0); fd = VSS_open(vsb_data(vsb), 10.);
for (i = 0; fd < 0 && i < 3; i++) {
(void)sleep(1);
fd = VSS_open(vsb_data(vsb), 0);
}
if (fd < 0) if (fd < 0)
vtc_log(c->vl, 0, "Failed to open %s", vsb_data(vsb)); vtc_log(c->vl, 0, "Failed to open %s", vsb_data(vsb));
assert(fd >= 0); assert(fd >= 0);
TCP_blocking(fd);
TCP_myname(fd, mabuf, sizeof mabuf, mpbuf, sizeof mpbuf); TCP_myname(fd, mabuf, sizeof mabuf, mpbuf, sizeof mpbuf);
vtc_log(vl, 3, "connected fd %d from %s %s to %s", vtc_log(vl, 3, "connected fd %d from %s %s to %s",
fd, mabuf, mpbuf, vsb_data(vsb)); fd, mabuf, mpbuf, vsb_data(vsb));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment