Commit c5a42168 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Implement schedule_neighbours_check.

parent ca5d3eaa
...@@ -800,6 +800,19 @@ main(int argc, char **argv) ...@@ -800,6 +800,19 @@ main(int argc, char **argv)
exit(1); exit(1);
} }
/* Schedule a neighbours check after roughly 3/2 msecs have elapsed. */
void
schedule_neighbours_check(int msecs, int override)
{
struct timeval timeout;
timeval_plus_msec(&timeout, &now, msecs + random() % msecs);
if(override)
check_neighbours_timeout = timeout;
else
timeval_min(&check_neighbours_timeout, &timeout);
}
void void
resize_receive_buffer(int size) resize_receive_buffer(int size)
{ {
......
...@@ -81,4 +81,5 @@ extern int kernel_socket; ...@@ -81,4 +81,5 @@ extern int kernel_socket;
extern int max_request_hopcount; extern int max_request_hopcount;
extern int update_interval; extern int update_interval;
void schedule_neighbours_check(int msecs, int override);
void resize_receive_buffer(int size); void resize_receive_buffer(int size);
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