normally, a zmq socket keeps re-connecting until it is connected. but if it connects to a wrong address, it could stop re-connecting.
one example is that say a zmq subscriber tries to conect to tcp://127.0.0.1:40008, and an echo server is started at 127.0.0.1:40008, this subscriber will connect to this address and then disconnect immediately due to protocol_error, and it will also stop re-connecting, so if later the echo server is stopped and a zmq publisher is started at this address, the subscriber won't connect to it to receive messages.
this is an issue as it happens silently, it's not easy to figure out what went wrong. is there a way to know that a protol_error (or any kind of error) occured inside zmq? or is there a way to make the subscriber reconnects no matter what causes disconnection?
======================update===================================I think I finally find out the root cause, it's caused by self connection.tcp self connect. this issue could be solved by using ports not within the range specified in /proc/sys/net/ipv4/ip_local_port_range.
and it seems that I already get notified from zmq for this kind of error which is the protocol_error event.I just didn't know that it means the socket will be discarded.