Created
August 18, 2013 07:35
-
-
Save lhope/6260410 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Test exiting zloop using a timer. | |
#include <czmq.h> | |
// timeout using the boxed int. | |
int s_timeout (zloop_t *loop, zmq_pollitem_t *poller, void *arg) | |
{ | |
int timeout = *((int*)arg); | |
zclock_sleep(timeout); | |
return -1; | |
} | |
int main (void) | |
{ | |
int timeout[] = { 500 }; | |
zloop_t *reactor = zloop_new (); | |
zloop_timer (reactor, 1000, 1, s_timeout, timeout); | |
zloop_start (reactor); | |
zloop_destroy (&reactor); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment