[zeromq-dev] ZMQ_POLLER
Doron Somech
somdoron at gmail.com
Wed Oct 21 09:32:39 CEST 2015
Hi All,
Few days ago I pushed ZMQ_POLLER to zeromq master. ZMQ_POLLER is a new API
to poll on multiple sockets and hopefully in the future will deprecate
ZMQ_POLL method.
ZMQ_POLLER API is very similar to zpoller from CZMQ. There are two main
reasons for ZMQ_POLLER:
* ZMQ_POLL doesn't support client and server sockets. I want one simple API
which will be able to support both thread-safe and not thread safe sockets.
ZMQ_POLLER support both.
* Using ZMQ_POLL is actually a little complicated to use and most binding
implement something like zpoller to make the usage simpler, now binding can
use ZMQ_POLLER directly.
The API is of course not stable yet and will appreciate comments, anyway
following is the ZMQ_POLLER API:
ZMQ_EXPORT void *zmq_poller_new ();
ZMQ_EXPORT int zmq_poller_close (void *poller);
ZMQ_EXPORT int zmq_poller_add_socket (void *poller, void *socket, void
*user_data, short events);
ZMQ_EXPORT int zmq_poller_modify_socket (void *poller, void *socket, short
events);
ZMQ_EXPORT int zmq_poller_remove_socket (void *poller, void *socket);
ZMQ_EXPORT int zmq_poller_wait (void *poller, zmq_poller_event_t *event,
long timeout);
ZMQ_EXPORT int zmq_poller_add_fd (void *poller, SOCKET fd, void *user_data,
short events);
ZMQ_EXPORT int zmq_poller_modify_fd (void *poller, SOCKET fd, short events);
ZMQ_EXPORT int zmq_poller_remove_fd (void *poller, SOCKET fd);
Following are two relevant pull requests (one of them is not merged yet):
https://github.com/zeromq/libzmq/pull/1616
https://github.com/zeromq/libzmq/pull/1611
Doron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20151021/c4ff3853/attachment.htm>
More information about the zeromq-dev
mailing list