Skip to content

Instantly share code, notes, and snippets.

@sustrik
Created October 2, 2011 14:48
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 sustrik/1257512 to your computer and use it in GitHub Desktop.
Save sustrik/1257512 to your computer and use it in GitHub Desktop.
#include <zmq.hpp>
int main (int argc, char *argv [])
{
zmq::context_t context (1);
zmq::socket_t s (context, ZMQ_XREP);
s.connect ("tcp://127.0.0.1:11132");
for (int i = 0; i < 1000; i++)
{
zmq::message_t identity;
s.recv (&identity);
zmq::message_t body;
s.recv (&body);
s.send (identity, ZMQ_SNDMORE);
s.send (body);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment