Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket can only Listen to one endpoint #97

Open
guidog opened this issue Nov 1, 2020 · 3 comments
Open

Socket can only Listen to one endpoint #97

guidog opened this issue Nov 1, 2020 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@guidog
Copy link
Contributor

guidog commented Nov 1, 2020

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

@sbinet sbinet added enhancement New feature or request help wanted Extra attention is needed labels Nov 6, 2020
@sbinet
Copy link
Contributor

sbinet commented Nov 6, 2020

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...)

@guidog
Copy link
Contributor Author

guidog commented Nov 7, 2020

  1. Would start with socket.accept taking the listener as parameter.
  2. Make accept Close the listener on exit.
  3. 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.

@sbinet
Copy link
Contributor

sbinet commented Nov 7, 2020

SGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants