[zeromq-dev] Improper use of PAIR sockets?

Pieter Hintjens ph at imatix.com
Mon Aug 17 12:26:05 CEST 2015

Sounds like a normal use for PAIR. Make sure you're checking return
codes on all calls, and then you can trace messages sent/received on
each side to see what's going wrong.

On Sat, Aug 8, 2015 at 8:38 PM, Bob Clarke <optionguy71 at gmail.com> wrote:
> I am developing a Windows application in C++ using 0MQ 4.1.2. The app will
> listen for machine status updates from up to eight data centers in the US
> and Europe. The server(s) are working fine, but it's inside the GUI client
> that a problem occurs.
> The GUI client contains one Listener object per data center, and each
> Listener stores some information obtained from its server. Some Listeners
> never get created because the user may not care about that data center
> (different use cases).
> The Listeners connect to a SUB socket and a REQ socket for acting on server
> messages, bind to an inproc PAIR socket for acting on UI requests, then sit
> in a polling loop, watching for messages. Each Listener uses Windows
> messages to communicate with the UI, and when the UI needs something from a
> Listener, it communicates via a local variable inproc PAIR socket: create
> and connect with the PAIR socket, ask the Listener for something, get the
> reply, set Linger to 0, close and delete (via destructor) the PAIR socket.
> The user is often just watching the app, but they may click on something for
> more information, which is why the UI then talks to a Listener, instead of
> the app creating PAIR sockets and leaving them open.
> The problem is that, eventually, the UI hangs and I have been able to
> consistently trace it back to a Listener's PAIR socket receiving a request,
> but then not returning. The number of Listeners does not seem to matter; I
> have disabled all but one and the problem still occurs. The hang may occur
> soon after the app starts and the user starts clicking around, or it may
> take hundreds of UI requests to a Listener for the hang to occur.
> I have not taken the time to distill this down to a small program yet. But,
> is this an improper use of the PAIR sockets?
> Thanks.
> Bob Clarke
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev

More information about the zeromq-dev mailing list