Created
July 12, 2011 10:39
-
-
Save hintjens/1077756 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #include <assert.h> | |
| #include <inttypes.h> | |
| #include "zmq.h" | |
| int main (void) | |
| { | |
| void *context = zmq_init (1); | |
| void *socket = zmq_socket (context, ZMQ_SUB); | |
| uint64_t one = 1; | |
| int rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &one, sizeof (uint64_t)); | |
| assert (rc == 0 || errno == ETERM); | |
| uint64_t affinity; | |
| size_t type_size = sizeof (uint64_t); | |
| zmq_getsockopt (socket, ZMQ_AFFINITY, &affinity, &type_size); | |
| assert (affinity == one); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment