Hi all,

I am struggling getting a simple timer to work with libev. What I want to achieve is a timer that gets called immediately, and then repeating every 2 seconds after that.

The docs describe various complex timer options, but miss the simplest version, and I am struggling for some reason.

If I do the following:

  ev_timer_init(&msg->timer.timer, watch_timed_message_cb, 0., 2.);
  ev_timer_start(msg->c->s->e->loop, &msg->timer.timer);

I expect the timer to fire in 0. seconds, and then start repeating every 2. seconds after that.

Instead the timer fires off once immediately, and then nothing.

Can anyone confirm whether there are further steps that I need to take before this will work?

Regards,
Graham
--

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to