[zeromq-dev] Hints about async pattern

Marco Trapanese marcotrapanese at gmail.com
Mon Apr 9 16:11:35 CEST 2012


Hello,

I'm playing with nzmqt on a simple application.
There are one router and a dozen of dealers. For each dealer I set its 
own identity, thus I can send async data in both directions.

It works fine, but now the router needs to know which clients are 
currently connected.

I periodically send a "ping" message [1]: if I receive a "pong" answer I 
assume it's alive. If it isn't the router will queue all non-dispatched 
messages.

I read the documentation and I'm aware I could use the HWM option to 
limit the queue size.

The best setting for the ping purpose is 1, which guarantees that only 
the most current ping will be answered. But this practice is discouraged 
in the guide. In fact it limits and slows down everything.

What do you recommend?

Thanks
Marco


[1]: this works because I know the maximum numbers of dealers, and I 
managed to set their identities between '0' and 'max'.




More information about the zeromq-dev mailing list