mardi 23 janvier 2018

Interrupt ZMQ poll

ZMQ provides a poll feature, zmq_poll, which essentially lets the API perform its own thread wait in the background while waiting for messages to arrive. When destructing the socket, I'm looking for a happy medium between interrupting a poll which has a long timeout or using a short timeout without an interrupt. Any advice?

I've found this solution How best to interrupt a zeroMQ poll method for cleanup and termination however this solution suggests that every socket object in the network requires a secondary UNIQUE address for the interrupt socket pair. Each interrupt needs a unique address to not erroneously trigger a different socket object to interrupt the poll. This seems like a horrible design. Am I really expected to have as many addresses/ports in use as socket objects in my network?

Aucun commentaire:

Enregistrer un commentaire