mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-27 15:41:05 +08:00
Problem: no example for STATISTICS in proxy manpage
Solution: add it
This commit is contained in:
parent
35c6985e68
commit
d61c47ef6f
@ -93,6 +93,21 @@ assert (zmq_send (control, "RESUME", 6, 0) == 0);
|
||||
|
||||
// terminate the proxy
|
||||
assert (zmq_send (control, "TERMINATE", 9, 0) == 0);
|
||||
|
||||
// check statistics
|
||||
assert (zmq_send (control, "STATISTICS", 10, 0) == 0);
|
||||
zmq_msg_t stats_msg;
|
||||
|
||||
while (1) {
|
||||
assert (zmq_msg_init (&stats_msg) == 0);
|
||||
assert (zmq_recvmsg (control, &stats_msg, 0) == sizeof (uint64_t));
|
||||
assert (rc == sizeof (uint64_t));
|
||||
printf ("Stat: %lu\n", *(unsigned long int *)zmq_msg_data (&stats_msg));
|
||||
if (!zmq_msg_get (&stats_msg, ZMQ_MORE))
|
||||
break;
|
||||
assert (zmq_msg_close (&stats_msg) == 0);
|
||||
}
|
||||
assert (zmq_msg_close (&stats_msg) == 0);
|
||||
---
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user