Skip to content

Instantly share code, notes, and snippets.

@hintjens
Last active August 29, 2015 13:55
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 hintjens/8689783 to your computer and use it in GitHub Desktop.
Save hintjens/8689783 to your computer and use it in GitHub Desktop.
#include <czmq.h>
int main (void) {
int repeat;
for (repeat = 0; repeat < 1000; repeat++) {
zctx_t *ctx = zctx_new ();
void *backend = zsocket_new (ctx, ZMQ_DEALER);
void *frontend = zsocket_new (ctx, ZMQ_DEALER);
int rc = zsocket_bind (backend, "ipc://@/something:%d", repeat);
assert (rc != -1);
rc = zsocket_connect (frontend, "ipc://@/something:%d", repeat);
assert (rc != -1);
zstr_send (frontend, "Hello");
zmsg_t *msg = zmsg_recv (backend);
zmsg_destroy (&msg);
zsocket_destroy (ctx, backend);
zsocket_destroy (ctx, frontend);
zctx_destroy (&ctx);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment