libzmq icon indicating copy to clipboard operation
libzmq copied to clipboard

Endpoint in monitor event is not always the same as the endpoint of the socket

Open thierryba opened this issue 3 years ago • 4 comments

test.zip This was tested on macOS with ZeroMQ 4.3.2.

The file test .zip contains the code. You can run that on the same machine. It essentially is a pub server and a sub client. It is derived from your example.

  1. start the pub_server.py
  2. start the pub_client.py you will see the client will receive messages. And Also monitor messages about the connection.
  3. kill the pub_server.py while pub_client is still running you will see something like: Event: {'event': 512, 'value': 18, 'endpoint': b'tcp://localhost:5556', 'description': 'EVENT_DISCONNECTED'} Event: {'event': 4, 'value': 190, 'endpoint': b'tcp://127.0.0.1:5556', 'description': 'EVENT_CONNECT_RETRIED'}

So even though, it was connected to localhost, the endpoint returned by the monitor event becomes its IP after it gets disconnected. That makes this value quite useless (and caused a bug in my code) because one cannot rely on the fact that this endpoint is the one one used when connecting to the server socket.

thierryba avatar Oct 07 '20 09:10 thierryba

I transferred this issue to zeromq/libzmq. cppzmq only passes through the values generated by libzmq.

sigiesec avatar Oct 07 '20 15:10 sigiesec

@sigiesec Thank you. My bad.

thierryba avatar Oct 07 '20 15:10 thierryba

Never mind :) The separation between cppzmq and libzmq is not obvious in all aspects.

sigiesec avatar Oct 07 '20 15:10 sigiesec

This issue has been automatically marked as stale because it has not had activity for 365 days. It will be closed if no further activity occurs within 56 days. Thank you for your contributions.

stale[bot] avatar Apr 16 '22 18:04 stale[bot]