[zeromq-dev] How to detect if a remote socket has closed

Pieter Hintjens ph at imatix.com
Mon Aug 16 21:01:53 CEST 2010


On Mon, Aug 16, 2010 at 7:26 PM,  <David.Briant at ubs.com> wrote:

> I’m coding in python and I can’t figure out how to detect if a remote
> process has closed or terminated (I exited my python server and judging from
> the cpu usage zmq is trying to re-establish connection but I just can’t see
> how to determine that in the API). Is it possible? and if so how do I do it.

You can't detect it, and that is deliberate.  From the Guide
(http://www.zeromq.org/docs:user-guide):

"In the ØMQ universe, sockets are clever multithreaded applications
that manage a whole set of connections automagically for you. You
can't see, work with, open, close, or attach state to these
connections. Whether you use blocking send or receive, or poll, all
you can talk to is the socket, not the connections it manages for you.
The connections are private and invisible, and this is the key to
ØMQ's scalability."

-
Pieter Hintjens
iMatix - www.imatix.com



More information about the zeromq-dev mailing list