51 rc =
zmq_bind (router,
"tcp://127.0.0.1:5555");
55 for (
int cycle = 0; cycle < 100; cycle++) {
60 sprintf (identity,
"%09d", cycle);
74 for (
int attempt = 0; attempt < 500; attempt++) {
80 rc =
zmq_send (router,
"HELLO", 5, 0);
85 rc =
zmq_recv (dealer, buffer, 5, 0);
87 assert (memcmp (buffer,
"HELLO", 5) == 0);
ZMQ_EXPORT int zmq_setsockopt(void *s, int option, const void *optval, size_t optvallen)
ZMQ_EXPORT void * zmq_ctx_new(void)
void setup_test_environment(void)
ZMQ_EXPORT int zmq_recv(void *s, void *buf, size_t len, int flags)
ZMQ_EXPORT void * zmq_socket(void *, int type)
#define ZMQ_ROUTER_MANDATORY
ZMQ_EXPORT int zmq_connect(void *s, const char *addr)
ZMQ_EXPORT int zmq_close(void *s)
ZMQ_EXPORT int zmq_ctx_destroy(void *context)
ZMQ_EXPORT int zmq_poll(zmq_pollitem_t *items, int nitems, long timeout)
ZMQ_EXPORT int zmq_send(void *s, const void *buf, size_t len, int flags)
void close_zero_linger(void *socket)
ZMQ_EXPORT int zmq_bind(void *s, const char *addr)