Commit e018c3b8 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Update now when sleeping.

parent e8e6a512
...@@ -565,7 +565,7 @@ main(int argc, char **argv) ...@@ -565,7 +565,7 @@ main(int argc, char **argv)
FD_ZERO(&readfds); FD_ZERO(&readfds);
} else { } else {
perror("select"); perror("select");
sleep(1); usleep(1000000);
continue; continue;
} }
} }
...@@ -586,7 +586,7 @@ main(int argc, char **argv) ...@@ -586,7 +586,7 @@ main(int argc, char **argv)
if(rc < 0) { if(rc < 0) {
if(errno != EAGAIN && errno != EINTR) { if(errno != EAGAIN && errno != EINTR) {
perror("recv"); perror("recv");
sleep(1); usleep(1000000);
} }
} else { } else {
for(i = 0; i < numnets; i++) { for(i = 0; i < numnets; i++) {
...@@ -692,6 +692,7 @@ main(int argc, char **argv) ...@@ -692,6 +692,7 @@ main(int argc, char **argv)
debugf("Exiting...\n"); debugf("Exiting...\n");
usleep(5000 + random() % 10000); usleep(5000 + random() % 10000);
gettimeofday(&now, NULL);
/* Uninstall and retract all routes. */ /* Uninstall and retract all routes. */
while(numroutes > 0) { while(numroutes > 0) {
...@@ -719,6 +720,7 @@ main(int argc, char **argv) ...@@ -719,6 +720,7 @@ main(int argc, char **argv)
send_hello_noupdate(&nets[i], numnets); send_hello_noupdate(&nets[i], numnets);
flushbuf(&nets[i]); flushbuf(&nets[i]);
usleep(5000 + random() % 10000); usleep(5000 + random() % 10000);
gettimeofday(&now, NULL);
} }
for(i = 0; i < numnets; i++) { for(i = 0; i < numnets; i++) {
if(!nets[i].up) if(!nets[i].up)
...@@ -727,6 +729,7 @@ main(int argc, char **argv) ...@@ -727,6 +729,7 @@ main(int argc, char **argv)
send_hello_noupdate(&nets[i], 1); send_hello_noupdate(&nets[i], 1);
flushbuf(&nets[i]); flushbuf(&nets[i]);
usleep(5000 + random() % 10000); usleep(5000 + random() % 10000);
gettimeofday(&now, NULL);
network_up(&nets[i], 0); network_up(&nets[i], 0);
} }
kernel_setup_socket(0); kernel_setup_socket(0);
......
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