Skip to content

Instantly share code, notes, and snippets.

@lipp
Created May 21, 2012 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lipp/2761607 to your computer and use it in GitHub Desktop.
Save lipp/2761607 to your computer and use it in GitHub Desktop.
reading ZMQ_FD
#include <zmq.hpp>
#include <assert.h>
int main(int argc, char* argv[])
{
zmq::context_t context(1);
// setup xreq and get fd
zmq::socket_t xreq(context, ZMQ_XREQ);
xreq.bind("tcp://127.0.0.1:13333");
size_t opt_size;
int xreq_fd = -1;
xreq.getsockopt(ZMQ_FD, &xreq_fd, &opt_size);
assert(xreq_fd > 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment