ZIO
Python and C++ interface to ZeroMQ and Zyre
test_rid.cpp
Go to the documentation of this file.
1 #include <czmq.h>
2 #ifndef ZMQ_SERVER
3 #error
4 #endif
5 int main()
6 {
7  zsock_t* s = zsock_new(ZMQ_SERVER);
8  zsock_bind(s, "inproc://testrid");
9  zsock_t* c = zsock_new(ZMQ_CLIENT);
10  zsock_connect(c, "inproc://testrid");
11 
12  zframe_t *f = zframe_new ("Hello", 5);
13  assert(f);
14  int rc = zframe_send(&f, c, 0);
15  assert(rc == 0);
16  assert(!f);
17 
18  f = zframe_recv(s);
19  assert(f);
20  assert (zframe_routing_id(f) != 0);
21  //assert (zsock_routing_id(s) != 0);
22 
23  zsock_destroy(&c);
24  zsock_destroy(&s);
25  return 0;
26 }
int main()
Definition: test_rid.cpp:5