-
-
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
gnet支持只设置SO_REUSEADDR防止服务端重启时因timewait而重启失败(addr in use) #266
Labels
Comments
不太理解你这句话里关于 |
socketopt支持REUSEADDR和REUSEPORT,前者针对timewait的端口可以重新绑定,不允许多进程使用同一ip和端口,而REUSEPORT允许多进程使用同一端口。我们现在有个需求只想解决timewait的问题,同时禁止多进程使用同一端口,理论上REUSEADDR是对我们需求的,但是gnet不支持专门针对REUSEADDR的指定选项
…---原始邮件---
发件人: "Andy ***@***.***>
发送时间: 2021年11月6日(周六) 晚上6:50
收件人: ***@***.***>;
抄送: ***@***.******@***.***>;
主题: Re: [panjf2000/gnet] gnet支持只设置SO_REUSEADDR防止服务端重启时因timewait而重启失败(addr in use) (Issue #266)
但我们很多场景不想设置SO_REUSEPORT(该选项无法防御多实例一个网络地址启动,存在使用的局限性)
不太理解你这句话,能再说具体点吗?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
你们是不想开启 |
现在这两个属性的确是同时设置的,你们有时间可以提个 PR 修改一下。 |
This was referenced Nov 19, 2021
0-haha
pushed a commit
to 0-haha/gnet
that referenced
this issue
Jan 25, 2023
Fixes panjf2000#266 Fixes panjf2000#272 Co-authored-by: zhongweikang <zhongweikang@sfmail.sf-express.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
背景:gnet目前支持ReusePort,目前gnet的实现上,该option除了设置SO_REUSEPORT 还设置了SO_REUSEADDR,但我们很多场景不想设置SO_REUSEPORT(该选项无法防御多实例一个网络地址启动,存在使用的局限性),我们只想设置SO_REUSEADDR,如这种场景:当重启server时,有一定概率重启失败,原因是server端主动关闭时,socket处于timewait状态,启动时无法绑定原来的地址(ip:port)导致
The text was updated successfully, but these errors were encountered: