zeromq/libzmq — pull request #867 by lalebarde (2014-02-02 14:25:05+00:00)
Title: add proxy_open_chain

zmq_proxy_open_chain - start built-in 0MQ a proxy chain in the same thread control flow, including end-points, such as client or worker. Doc and test included. It uses LTS (local thread static), so conditional compuilation ensures it is available. Otherwise, the function just asserts.

Verbose output of test_proxy_open_chain (10 threads with 2 proxies and 2 end-point per thread, to validate LTS):

```
[Console output redirected to file:/tmp/txx]
Thread 3 ready with addresses:
tcp://127.0.0.1:9996, inproc://intermediate03, inproc://backend03
Thread 4 ready with addresses:
tcp://127.0.0.1:9995, inproc://intermediate04, inproc://backend04
Thread 5 ready with addresses:
tcp://127.0.0.1:9994, inproc://intermediate05, inproc://backend05
Thread 6 ready with addresses:
tcp://127.0.0.1:9993, inproc://intermediate06, inproc://backend06
Thread 7 ready with addresses:
tcp://127.0.0.1:9992, inproc://intermediate07, inproc://backend07
Thread 1 ready with addresses:
tcp://127.0.0.1:9998, inproc://intermediate01, inproc://backend01
Thread 9 ready with addresses:
tcp://127.0.0.1:9990, inproc://intermediate09, inproc://backend09
Thread 0 ready with addresses:
tcp://127.0.0.1:9999, inproc://intermediate00, inproc://backend00
Thread 8 ready with addresses:
tcp://127.0.0.1:9991, inproc://intermediate08, inproc://backend08
Thread 2 ready with addresses:
tcp://127.0.0.1:9997, inproc://intermediate02, inproc://backend02
server receive - identity = BB41-BF32 content = request #001
server receive - identity = 58AC-2384 content = request #001
server receive - identity = BE92-51DB content = request #001
server receive - identity = F38E-4210 content = request #001
server receive - identity = 08FF-2531 content = request #001
client receive - identity = 58AC-2384 content = request #001
server receive - identity = AEA6-FCA5 content = request #001
server receive - identity = 1AD3-A1A8 content = request #001
server receive - identity = 1535-E43F content = request #001
server receive - identity = 5641-B0F2 content = request #001
client receive - identity = BB41-BF32 content = request #001
client receive - identity = AEA6-FCA5 content = request #001
server receive - identity = 60DC-F95E content = request #001
client receive - identity = 08FF-2531 content = request #001
client receive - identity = 1535-E43F content = request #001
client receive - identity = F38E-4210 content = request #001
client receive - identity = BE92-51DB content = request #001
client receive - identity = 5641-B0F2 content = request #001
client receive - identity = 1AD3-A1A8 content = request #001
client receive - identity = 60DC-F95E content = request #001
server receive - identity = 58AC-2384 content = request #002
server receive - identity = BB41-BF32 content = request #002
server receive - identity = AEA6-FCA5 content = request #002
server receive - identity = 08FF-2531 content = request #002
server receive - identity = 1535-E43F content = request #002
server receive - identity = F38E-4210 content = request #002
server receive - identity = BE92-51DB content = request #002
server receive - identity = 5641-B0F2 content = request #002
server receive - identity = 1AD3-A1A8 content = request #002
server receive - identity = 60DC-F95E content = request #002
client receive - identity = 58AC-2384 content = request #002
client receive - identity = 58AC-2384 content = request #002
client receive - identity = 08FF-2531 content = request #002
client receive - identity = 08FF-2531 content = request #002
client receive - identity = AEA6-FCA5 content = request #002
client receive - identity = AEA6-FCA5 content = request #002
client receive - identity = 1535-E43F content = request #002
client receive - identity = 1535-E43F content = request #002
client receive - identity = 1AD3-A1A8 content = request #002
client receive - identity = 1AD3-A1A8 content = request #002
client receive - identity = 5641-B0F2 content = request #002
client receive - identity = 5641-B0F2 content = request #002
client receive - identity = BB41-BF32 content = request #002
client receive - identity = BB41-BF32 content = request #002
client receive - identity = F38E-4210 content = request #002
client receive - identity = F38E-4210 content = request #002
client receive - identity = BE92-51DB content = request #002
client receive - identity = BE92-51DB content = request #002
client receive - identity = 60DC-F95E content = request #002
client receive - identity = 60DC-F95E content = request #002
server receive - identity = 58AC-2384 content = request #003
server receive - identity = 08FF-2531 content = request #003
server receive - identity = AEA6-FCA5 content = request #003
server receive - identity = 1535-E43F content = request #003
server receive - identity = 1AD3-A1A8 content = request #003
server receive - identity = 5641-B0F2 content = request #003
server receive - identity = BB41-BF32 content = request #003
server receive - identity = F38E-4210 content = request #003
client receive - identity = 58AC-2384 content = request #003
client receive - identity = 58AC-2384 content = request #003
client receive - identity = 58AC-2384 content = request #003
server receive - identity = BE92-51DB content = request #003
server receive - identity = 60DC-F95E content = request #003
client receive - identity = 1AD3-A1A8 content = request #003
client receive - identity = 1AD3-A1A8 content = request #003
client receive - identity = 1AD3-A1A8 content = request #003
client receive - identity = 5641-B0F2 content = request #003
client receive - identity = 5641-B0F2 content = request #003
client receive - identity = 5641-B0F2 content = request #003
client receive - identity = 08FF-2531 content = request #003
client receive - identity = 08FF-2531 content = request #003
client receive - identity = 08FF-2531 content = request #003
client receive - identity = BB41-BF32 content = request #003
client receive - identity = BB41-BF32 content = request #003
client receive - identity = BB41-BF32 content = request #003
client receive - identity = 60DC-F95E content = request #003
client receive - identity = 60DC-F95E content = request #003
client receive - identity = 60DC-F95E content = request #003
client receive - identity = 1535-E43F content = request #003
client receive - identity = 1535-E43F content = request #003
client receive - identity = 1535-E43F content = request #003
client receive - identity = AEA6-FCA5 content = request #003
client receive - identity = AEA6-FCA5 content = request #003
client receive - identity = AEA6-FCA5 content = request #003
client receive - identity = F38E-4210 content = request #003
client receive - identity = F38E-4210 content = request #003
client receive - identity = F38E-4210 content = request #003
client receive - identity = BE92-51DB content = request #003
client receive - identity = BE92-51DB content = request #003
client receive - identity = BE92-51DB content = request #003
server receive - identity = 58AC-2384 content = request #001
client receive - identity = 58AC-2384 content = request #001
server receive - identity = 1AD3-A1A8 content = request #001
client receive - identity = 1AD3-A1A8 content = request #001
server receive - identity = 5641-B0F2 content = request #001
server receive - identity = 08FF-2531 content = request #001
server receive - identity = BB41-BF32 content = request #001
client receive - identity = 08FF-2531 content = request #001
server receive - identity = 1535-E43F content = request #001
server receive - identity = 60DC-F95E content = request #001
client receive - identity = 5641-B0F2 content = request #001
server receive - identity = AEA6-FCA5 content = request #001
server receive - identity = F38E-4210 content = request #001
client receive - identity = F38E-4210 content = request #001
client receive - identity = BB41-BF32 content = request #001
client receive - identity = 60DC-F95E content = request #001
server receive - identity = BE92-51DB content = request #001
client receive - identity = 1535-E43F content = request #001
client receive - identity = AEA6-FCA5 content = request #001
client receive - identity = BE92-51DB content = request #001
server receive - identity = 58AC-2384 content = request #002
server receive - identity = 1AD3-A1A8 content = request #002
client receive - identity = 58AC-2384 content = request #002
client receive - identity = 58AC-2384 content = request #002
server receive - identity = 08FF-2531 content = request #002
server receive - identity = 5641-B0F2 content = request #002
client receive - identity = 1AD3-A1A8 content = request #002
server receive - identity = F38E-4210 content = request #002
client receive - identity = 1AD3-A1A8 content = request #002
server receive - identity = BB41-BF32 content = request #002
server receive - identity = 60DC-F95E content = request #002
server receive - identity = 1535-E43F content = request #002
client receive - identity = 08FF-2531 content = request #002
client receive - identity = 08FF-2531 content = request #002
server receive - identity = AEA6-FCA5 content = request #002
client receive - identity = 5641-B0F2 content = request #002
client receive - identity = 5641-B0F2 content = request #002
client receive - identity = 60DC-F95E content = request #002
client receive - identity = 60DC-F95E content = request #002
client receive - identity = F38E-4210 content = request #002
client receive - identity = F38E-4210 content = request #002
server receive - identity = BE92-51DB content = request #002
client receive - identity = BB41-BF32 content = request #002
client receive - identity = BB41-BF32 content = request #002
client receive - identity = AEA6-FCA5 content = request #002
client receive - identity = AEA6-FCA5 content = request #002
client receive - identity = 1535-E43F content = request #002
client receive - identity = 1535-E43F content = request #002
client receive - identity = BE92-51DB content = request #002
client receive - identity = BE92-51DB content = request #002
server receive - identity = 58AC-2384 content = request #003
server receive - identity = 1AD3-A1A8 content = request #003
client receive - identity = 58AC-2384 content = request #003
client receive - identity = 58AC-2384 content = request #003
client receive - identity = 58AC-2384 content = request #003
server receive - identity = 08FF-2531 content = request #003
server receive - identity = 5641-B0F2 content = request #003
server receive - identity = 60DC-F95E content = request #003
server receive - identity = F38E-4210 content = request #003
client receive - identity = 1AD3-A1A8 content = request #003
client receive - identity = 1AD3-A1A8 content = request #003
client receive - identity = 1AD3-A1A8 content = request #003
server receive - identity = BB41-BF32 content = request #003
server receive - identity = AEA6-FCA5 content = request #003
server receive - identity = 1535-E43F content = request #003
server receive - identity = BE92-51DB content = request #003
client receive - identity = 08FF-2531 content = request #003
client receive - identity = 08FF-2531 content = request #003
client receive - identity = 08FF-2531 content = request #003
client receive - identity = AEA6-FCA5 content = request #003
client receive - identity = AEA6-FCA5 content = request #003
client receive - identity = AEA6-FCA5 content = request #003
client receive - identity = BB41-BF32 content = request #003
client receive - identity = BB41-BF32 content = request #003
client receive - identity = BB41-BF32 content = request #003
client receive - identity = 5641-B0F2 content = request #003
client receive - identity = 5641-B0F2 content = request #003
client receive - identity = 5641-B0F2 content = request #003
client receive - identity = 60DC-F95E content = request #003
client receive - identity = 60DC-F95E content = request #003
client receive - identity = 60DC-F95E content = request #003
client receive - identity = F38E-4210 content = request #003
client receive - identity = F38E-4210 content = request #003
client receive - identity = F38E-4210 content = request #003
client receive - identity = 1535-E43F content = request #003
client receive - identity = 1535-E43F content = request #003
client receive - identity = 1535-E43F content = request #003
client receive - identity = BE92-51DB content = request #003
client receive - identity = BE92-51DB content = request #003
client receive - identity = BE92-51DB content = request #003
All threads have received 12 messages
```