I'm a beginner and I've tried using with ZMQ monitor queue but I'm not getting expected result
-
I do not think you can. Why do need to know this? ZeroMQ handles the details of connecting/disconnecting so you don't have to. – rveerd Feb 11 '20 at 13:22
1 Answers
Q : How to know socket status(connected or not) in python?
a ) By exception(s) :
thrown in common in situations, when the requested call to API ( API service ) was asked in such a moment, the socket-object was not in a state to execute it
( for this, see the native-API documentation for details on reporting failed state via zmq_errno()
et al )
b ) By introspection :
ZeroMQ API reports the rc
( Return Code detecting the { PASS | FAIL }
result of a native-API call )
Python wrappers ( pyzmq vX.Y ), the more the recent efforts to re-wrap this already wrapper-re-formulated native-API tools, complicate the way, how to learn intrinsic details about the { PASS | FAIL }
result of the most recent re-wrapped call to native-API.
Best read first the original ZeroMQ native API documentation, so as to see what gets when reported via the native zmq_errno()
and all the rest about the internal state(s) of the system is to be deducted from FSA-events ( reported via the native-API socket_monitor
tool ( having this again re-wrapped by a wrapper-mediated counterparty in pyzmq
- so test its suitability for your use-case ) ).

- 1
- 6
- 50
- 92