Skip to content

Instantly share code, notes, and snippets.

@sustrik
Created March 10, 2011 00:20
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/863307 to your computer and use it in GitHub Desktop.
Save sustrik/863307 to your computer and use it in GitHub Desktop.
#include <zmq.hpp>
#include <unistd.h>
int main ()
{
zmq::context_t ctx (1);
zmq::socket_t s1 (ctx, ZMQ_XREP);
s1.setsockopt (ZMQ_IDENTITY, "A", 1);
s1.bind ("tcp://lo:5555");
zmq::socket_t s2 (ctx, ZMQ_XREP);
s2.connect ("tcp://localhost:5555");
s2.connect ("tcp://localhost:5555");
sleep (1);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment