- /* Try to make outgoing connections */
-
- try_outgoing_connections();
-}
-
-/*
- this is where it all happens...
-*/
-int main_loop(void)
-{
- struct timeval tv;
- int r;
- time_t last_ping_check;
- tevent_t *event;
- struct event timeout;
- struct event sighup_event;
-
- cp();
-
- signal_set(&sighup_event, SIGHUP, sighup_handler, NULL);
- signal_add(&sighup_event, NULL);
-
- last_ping_check = now;
-
- srand(now);
-
- running = true;
-
- while(running) {
- now = time(NULL);
-
- // tv.tv_sec = 1 + (rand() & 7); /* Approx. 5 seconds, randomized to prevent global synchronisation effects */
- tv.tv_sec = 1;
- tv.tv_usec = 0;
-
- /* XXX: libevent transition: old timeout code in this loop */
- timeout_set(&timeout, dummy, NULL);
- timeout_add(&timeout, &tv);