zmq4
zmq4 copied to clipboard
Socket can only Listen to one endpoint
Hi!
Discovered while working on #85.
The socket struct does only allow for one listener per socket.
IMHO this is against the ZeroMQ idea. Would classify that as a bug.
Could use that as the reason to revamp the whole listen/connect/reconnect mechanic.
Relates to #40.
Cheers Guido
SGTM. (although I am not sure this couldn't be implemented as an orthogonal component, like io.MultiReader
, but this could indeed be more efficiently implemented within socket
...)
- Would start with
socket.accept
taking the listener as parameter. - Make accept Close the listener on exit.
- Break the listen loop on errors on the listener (to prevent endless Cpu hogging loop).
These steps wouldn't need changes on the socket structure.
Next would be to come up with an idea on how to track the active listeners. This would allow to un-listen specific endpoints.
SGTM.