kike: implement the ping-pong and QUIT

This commit is contained in:
2014-08-02 00:09:23 +02:00
parent 9720e30c8b
commit 2fe3c7ed45
2 changed files with 144 additions and 10 deletions

View File

@@ -961,6 +961,15 @@ poller_timers_find (struct poller_timers *self,
return -1;
}
static ssize_t
poller_timers_find_by_data (struct poller_timers *self, void *data)
{
for (size_t i = 0; i < self->len; i++)
if (self->info[i].user_data == data)
return i;
return -1;
}
static void
poller_timers_add (struct poller_timers *self,
poller_timer_func dispatcher, void *data, int timeout_ms)