Guest User

zeromq_epgm_pub.c

a guest
Aug 1st, 2013
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <stdbool.h>
  4. #include <string.h>
  5. #include <czmq.h>
  6.  
  7. #include <assert.h>
  8.  
  9.  
  10. int main ()
  11. {
  12.         zctx_t *zctx = zctx_new();
  13.  
  14.         zctx_set_linger(zctx, 1000);
  15.  
  16.         void *zsocket = zsocket_new (zctx, ZMQ_PUB);
  17.         assert(zsocket);
  18.  
  19.         zsockopt_set_recovery_ivl (zsocket, 1);
  20.         zsocket_bind (zsocket, "epgm://239.77.77.77:5556");
  21.  
  22.         zstr_send (zsocket,"MESSAGE: HI");
  23.  
  24.         zsocket_destroy(zctx, zsocket);
  25.         zctx_destroy(&zctx);
  26.  
  27.         return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment