Pandrei
Pandrei

Reputation: 4951

ZMQ Dealer-Router connection monitoring

I have several dealers connecting to one Router socket. The dealers send data asynchronously and the Router gathers/processes the data. What I need to do is find a way to know when a dealer has stopped sending data/disconnected from the router socket.

I build a map of all the connection identities.

I have a monitor connected the the router port and I receive notifications for connects/disconnects.

The problem is I can't find a way to identify which dealer the monitor notifications are for. The notifications only give me a FD which is of little use.

Is there a way to map between notifications and connection IDs?

Upvotes: 1

Views: 1256

Answers (1)

DontPanic
DontPanic

Reputation: 1367

If not mistaken, the zeroMq allows you to determine only the fact of connection/disconnection.

In my opinion, a good solution would be something like this: when the notification is received, ROUTER must send to all connected dealers a heartbeat message with a timeout and the one who did not respond - disconnected.

Upvotes: 3

Related Questions