[zeromq-dev] Questions about socket errors

Brian Granger ellisonbg at gmail.com
Wed Feb 10 23:23:28 CET 2010


I am starting to look at using the Python interface to zeromq and have
some questions about error handling.
In particular, I am wondering how socket related errors are handled in
Python.  Some examples of what I saw:

* If I do s.connect to an endpoint that doesn't exist, it returns
happily as though it were fine.
* If I do a recv/send to an endpoint that lost its connection, it
hangs or returns happliy (NOBLOCK).

I am guessing that this behavior is unique to the Python bindings.  So
first a bigger question:  what is the model
in the C API for handling these types of socket related errors?  In
particular I am interested in keeping track of what
clients are connected to an application that is listening on a set of
sockets (it is like a message hub) and knowing
when those connections are lost or error in any way.  I need to be
able to perform message routing in this application
that *depends* on what clients are connected.  At the C-level, how can
I detect and react to these errors?

The next question is how all of this is exposed in the Python bindings.



Brian E. Granger, Ph.D.
Assistant Professor of Physics
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu
ellisonbg at gmail.com

More information about the zeromq-dev mailing list