mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-19 18:03:50 +00:00
Problem: zmq_poller example is wrong
Solution: flipped arguments in example
This commit is contained in:
parent
805564b996
commit
ba6695c59a
@ -264,9 +264,9 @@ void *poller = zmq_poller_new ();
|
|||||||
|
|
||||||
zmq_poller_event_t events [2];
|
zmq_poller_event_t events [2];
|
||||||
/* First item refers to 0MQ socket 'socket' */
|
/* First item refers to 0MQ socket 'socket' */
|
||||||
zmq_poller_add (poller, socket, ZMQ_POLLIN, NULL);
|
zmq_poller_add (poller, socket, NULL, ZMQ_POLLIN);
|
||||||
/* Second item refers to standard socket 'fd' */
|
/* Second item refers to standard socket 'fd' */
|
||||||
zmq_poller_add_fd (poller, fd, ZMQ_POLLIN, NULL);
|
zmq_poller_add_fd (poller, fd, NULL, ZMQ_POLLIN);
|
||||||
/* Poll for events indefinitely */
|
/* Poll for events indefinitely */
|
||||||
int rc = zmq_poller_wait_all (items, events, 2, -1);
|
int rc = zmq_poller_wait_all (items, events, 2, -1);
|
||||||
assert (rc >= 0);
|
assert (rc >= 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user