I have had a zeromq MatLab system working well for over a year (MatLab used jeromq-5.2) but now the Linux version of the compiled MatLab executable is misbehaving intermittently. To try and track this down I have written a simple pub program in python, and a corresponding sub program. Both the pub and sub include a call to get_monitor_socket()
, and start a separate thread to monitor the pub or sub socket respectively. What I have noticed is that when running on windows the sub program produces different output to the identical program running on linux. (Windows 10 and RHEL 7.4, also tested on Ubuntu 18). Using Python 3.11 on both machines and zmq v 4.3.4
On windows the sub socket seems to disconnect and retry connecting every two seconds, but on Linux the only event reported by the monitor is Event.CONNECT_DELAYED
, and then nothing. Sometimes the events come through from the other machine, and sometimes not.Any ideas why this is so, or any suggestions to help with debugging?
Windows monitoring output
zmq SUB attempting connect to port 7000 using connect string tcp://192.168.0.110:7000----------------------------------------2023-11-23 20:53:31.897676 connect req----------------------------------------2023-11-23 20:53:31.900674 set subscribe topic filter2023-11-23 20:53:31.901673 Event: {'event': <Event.CONNECT_DELAYED: 2>, 'value': 'N/A', 'endpoint': b'tcp://192.168.0.110:7000'}2023-11-23 20:53:33.955834 Event: {'event': <Event.CLOSED: 128>, 'value': 'FD of underlying socket (now closed) 520', 'endpoint': b'tcp://192.168.0.110:7000'}2023-11-23 20:53:33.955834 Event: {'event': <Event.CONNECT_RETRIED: 4>, 'value': 'reconnect interval (milliSec) 189', 'endpoint': b'tcp://192.168.0.110:7000'}2023-11-23 20:53:34.158269 Event: {'event': <Event.CONNECT_DELAYED: 2>, 'value': 'N/A', 'endpoint': b'tcp://192.168.0.110:7000'}2023-11-23 20:53:36.223674 Event: {'event': <Event.CLOSED: 128>, 'value': 'FD of underlying socket (now closed) 520', 'endpoint': b'tcp://192.168.0.110:7000'}2023-11-23 20:53:36.224689 Event: {'event': <Event.CONNECT_RETRIED: 4>, 'value': 'reconnect interval (milliSec) 134', 'endpoint': b'tcp://192.168.0.110:7000'}2023-11-23 20:53:36.364665 Event: {'event': <Event.CONNECT_DELAYED: 2>, 'value': 'N/A', 'endpoint': b'tcp://192.168.0.110:7000'}2023-11-23 20:53:38.429768 Event: {'event': <Event.CLOSED: 128>, 'value': 'FD of underlying socket (now closed) 520', 'endpoint': b'tcp://192.168.0.110:7000'}2023-11-23 20:53:38.429768 Event: {'event': <Event.CONNECT_RETRIED: 4>, 'value': 'reconnect interval (milliSec) 169', 'endpoint': b'tcp://192.168.0.110:7000'}2023-11-23 20:53:38.599557 Event: {'event': <Event.CONNECT_DELAYED: 2>, 'value': 'N/A', 'endpoint': b'tcp://192.168.0.110:7000'}2023-11-23 20:53:40.647753 Event: {'event': <Event.CLOSED: 128>, 'value': 'FD of underlying socket (now closed) 552', 'endpoint': b'tcp://192.168.0.110:7000'}2023-11-23 20:53:40.648760 Event: {'event': <Event.CONNECT_RETRIED: 4>, 'value': 'reconnect interval (milliSec) 178', 'endpoint': b'tcp://192.168.0.110:7000'}2023-11-23 20:53:40.833007 Event: {'event': <Event.CONNECT_DELAYED: 2>, 'value': 'N/A', 'endpoint': b'tcp://192.168.0.110:7000'}2023-11-23 20:53:42.901665 Event: {'event': <Event.CLOSED: 128>, 'value': 'FD of underlying socket (now closed) 556', 'endpoint': b'tcp://192.168.0.110:7000'}2023-11-23 20:53:42.901665 Event: {'event': <Event.CONNECT_RETRIED: 4>, 'value': 'reconnect interval (milliSec) 162', 'endpoint': b'tcp://192.168.0.110:7000'}2023-11-23 20:53:43.074015 Event: {'event': <Event.CONNECT_DELAYED: 2>, 'value': 'N/A', 'endpoint': b'tcp://192.168.0.110:7000'}
Linux Monitoring Output
zmq SUB attempting connect to port 7000 using connect string tcp://192.168.0.109:7000----------------------------------------2023-11-23 18:52:55.372833 connect req----------------------------------------2023-11-23 18:52:55.373045 set subscribe topic filter2023-11-23 18:52:55.373589 Event: {'event': <Event.CONNECT_DELAYED: 2>, 'value': 'N/A', 'endpoint': b'tcp://192.168.0.109:7000'}