[zeromq-dev] Polling API

Martin Sustrik sustrik at 250bpm.com
Wed Apr 14 11:48:13 CEST 2010


Ok,

Here's a first sketch:

//  Account for both 0MQ sockets and file descriptors.
union zmq_poll_item_t
{
     void *socket;
     int fd;
};

//  Construction & destruction.
void *zmq_poller (void *context);
int zmq_poller_close (void *poller);

//  Pollset manipulation.
int zmq_poller_mod (void *poller, zmq_poll_item_t item, int events, void 
*hint);

//  Getting events.
int zmq_poller_event (void *poller, zmq_poll_item_t *item, int *events, 
void **hint);

Comments anyone?

Maybe zmq_pollset would be more appropriate than zmq_poller?

Martin



More information about the zeromq-dev mailing list