Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- CZMQ Version: 2.2.0
- ZeroMQ Version: 4.0.4
- GCC:
- gcc (Debian 4.7.2-5) 4.7.2
- Copyright (C) 2012 Free Software Foundation, Inc.
- This is free software; see the source for copying conditions. There is NO
- warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- jricher@eris$ gcc -otestcase -lzmq -lczmq testcase.c
- jricher@eris$ ./testcase
- Unable to bind port inproc://mike
- Exiting...
- Errno: Resource temporarily unavailable
- Numeric Value: 11
- */
- #include <czmq.h>
- const char msgbus_bind[]="inproc://mike";
- const char msgbus_connect[]="inproc://mike";
- void main(void) {
- zctx_t *zctx=zctx_new();
- assert(zctx);
- void *sock_msgbus = zsocket_new(zctx, ZMQ_ROUTER);
- assert(sock_msgbus);
- int rv = zsocket_bind(sock_msgbus, msgbus_bind);
- if (rv == 0) {
- printf("Unable to bind port %s\nExiting...\n",msgbus_bind);
- printf("Errno: %s\n",strerror(errno));
- printf("Numeric Value: %i\n", errno);
- }
- zsocket_destroy(zctx, sock_msgbus);
- zctx_destroy(&zctx);
- }
Advertisement
Add Comment
Please, Sign In to add comment