zeromq / libzmq

ZeroMQ core engine in C++, implements ZMTP/3.1
https://www.zeromq.org
Mozilla Public License 2.0
9.62k stars 2.35k forks source link

Adding zrouting-id in the socket monitor message. #4525

Open sridhar-arrcus opened 1 year ago

sridhar-arrcus commented 1 year ago

Please use this template for reporting suspected bugs or requests for help.

Issue description

When using zmq_socket_moniter on Router socket, the notification provides the event and event_val (fd). I also get the address in the next part. I am not able to identify the peer. is there is a way to pass on the zrouting_id in the notification message.

router being server (bind) end-point, there can be multiple peer (clients) that can connet to it. not able to identify the peer from the notification message.

Please let me know if there exists a means to already deal with this.

Environment

Minimal test code / Steps to reproduce the issue

What's the actual result? (include assertion message & call stack if applicable)

event= ZMQ_EVENT_DISCONNECTED event_val = fd

2nd part address = "127.0.0.1:5555"

What's the expected result?

event= ZMQ_EVENT_DISCONNECTED event_val = fd

2nd part address = "127.0.0.1:5555"

3rd part zrouting_id = "5 byte value"

/ with the zrouting-id, app can identify the client peer and take necessary action /

Thanks Sridhar Pitchai

jiazhanfeng1989 commented 1 year ago

Is there any update? we also need this feature.

hoditohod commented 1 year ago

As far as I know the ZMQ monitor API is asynchronous (not synchronized to the socket activity it's monitoring), and it is intended for diagnostic purposes only. If you really need connect/disconnect notifications for router socket peers then there's a ZMQ_ROUTER_NOTIFY draft socket option for this.

On Tue, Jun 27, 2023 at 12:30 PM jiazhanfeng @.***> wrote:

Is there any update? we also need this feature.

— Reply to this email directly, view it on GitHub https://github.com/zeromq/libzmq/issues/4525#issuecomment-1609230525, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCSVEBI52MXOLLEJM7AFO3XNKY3VANCNFSM6AAAAAAVO7PK4Y . You are receiving this because you are subscribed to this thread.Message ID: @.***>

sridhar-arrcus commented 1 year ago

Thanks, let me try it.


From: Szekely Gyorgy @.> Sent: Tuesday, June 27, 2023 7:10:19 AM To: zeromq/libzmq @.> Cc: Sridhar Pitchai @.>; Author @.> Subject: Re: [zeromq/libzmq] Adding zrouting-id in the socket monitor message. (Issue #4525)

As far as I know the ZMQ monitor API is asynchronous (not synchronized to the socket activity it's monitoring), and it is intended for diagnostic purposes only. If you really need connect/disconnect notifications for router socket peers then there's a ZMQ_ROUTER_NOTIFY draft socket option for this.

On Tue, Jun 27, 2023 at 12:30 PM jiazhanfeng @.***> wrote:

Is there any update? we also need this feature.

— Reply to this email directly, view it on GitHub https://github.com/zeromq/libzmq/issues/4525#issuecomment-1609230525, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCSVEBI52MXOLLEJM7AFO3XNKY3VANCNFSM6AAAAAAVO7PK4Y . You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHubhttps://github.com/zeromq/libzmq/issues/4525#issuecomment-1609588223, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AM7NXHHDOKAGUG6BIA3VFD3XNLSUXANCNFSM6AAAAAAVO7PK4Y. You are receiving this because you authored the thread.Message ID: @.***>

[EXTERNAL]