zeromq/libzmq — pull request #712 by lalebarde (2013-10-18 09:29:53+00:00)
Title: add proxy control flow and test

Rationals:
1) There was no way to stop or suspend a proxy. With this commit, one is able to pass a control socket to proxy as an optional fourth argument, and send STOP/RESUME/TERMINATE commands to it.
2) There was no test for proxy. This was not necessarily usefull since one can consider it is covered by analysis and use track records. Though this may be required by some users and it is a base for experiments. BTW, the test takes only 500 ms, so it is not a penalty.

Implementation:
The test is a port of the 0MQ Guide's "Asynchronous client-to-server (DEALER to ROUTER)" with pure libzmq (no czmq). A millisecond sleep has been added to testutils.hpp. proxy.cpp has been modified to add the flow control. proxy is fully backward compatible : the 4th argument is optional and the default behaviour is the RESUME mode which behaves exactly has before.

TODO:
1) update documentation.
2) add test for STOP/RESUME (only TERMINATE is tested for now)