-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat: add multiple listener support #413
Conversation
if ln, err = initListener(network, addr, options); err != nil { | ||
return | ||
listeners := make(map[int]*listener) | ||
for _, addr := range strings.Split(addrs, ",") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should update parseProtoAddr() to support string format: "tcp://192.168.0.100:8000,tcp://192.168.0.100:8001,tcp://192.168.0.100:8002" to maintain compatibility when gnet supports multiple listener with different protocols in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, thanks. I will try to fix it and add appropriate tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this feature, please add some tests for it.
bac08a4
to
1418ec9
Compare
099ac41
to
9b502e3
Compare
Wondering if this supports binding multiple protocols at one, for ex. Mixing udp and tcp. Also, is there any news on this? |
Is there a planned time to accept this PR? |
This PR is still in WIP status, I'd love to review it once @leki75 finishes it. |
fa1dc24
to
5d1cf9e
Compare
Move to #578 |
1. Are you opening this pull request for bug-fixes, optimizations or new feature?
New feature
2. Please describe how these code changes achieve your intention.
This PR will add multi-listener support. The user can specify multiple IP:port pairs separated by commas.
3. Please link to the relevant issues (if any).
4. Which documentation changes (if any) need to be made/updated because of this PR?
The
gnet.Run
command will accept multiple IP:port pairs like this:4. Checklist