We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
TCP Server设置了5秒的KeepAlive时间,gnet.WithTCPKeepAlive(5*time.Second),在压测时,Client与Server大概建立了8000+条TCP连接,Client在运行中crash掉了,但Server端并没有按照设置的KeepAlive断开连接。
看了一下源码,TCP_KEEPINTVL和TCP_KEEPIDLE设置了5s,TCP_KEEPCNT没有设置,系统设置的是9。所以总的断开时间应该是5 + 5*9 = 50s。也就是说50s后,server端会断开连接。
但我抓包看,server端并没有发送keepalive,而是每隔120s进行一次重传。65.78是server,65.79是client
v2
v2.3.0
Linux
Linux 5.4.56.bsk.9-amd64 x86_64
go version go1.18.2 linux/amd64
没有设置logger
No response
I haven't verified it with the latest release
The text was updated successfully, but these errors were encountered:
能提供一下可以复现这个问题的客户端和服务端代码吗?
Sorry, something went wrong.
代码需要整理一下,需要提取出来
最近 gnet 对 TCP Keep-Alives 设置做了以下优化: #522,可以验证一下这个问题是否存在,我先关闭 issue 了,如果还有问题可以随时重新打开这个 issue
gnet
panjf2000
No branches or pull requests
Actions I've taken before I'm here
What happened?
TCP Server设置了5秒的KeepAlive时间,gnet.WithTCPKeepAlive(5*time.Second),在压测时,Client与Server大概建立了8000+条TCP连接,Client在运行中crash掉了,但Server端并没有按照设置的KeepAlive断开连接。
看了一下源码,TCP_KEEPINTVL和TCP_KEEPIDLE设置了5s,TCP_KEEPCNT没有设置,系统设置的是9。所以总的断开时间应该是5 + 5*9 = 50s。也就是说50s后,server端会断开连接。
但我抓包看,server端并没有发送keepalive,而是每隔120s进行一次重传。65.78是server,65.79是client
Major version of gnet
v2
Specific version of gnet
v2.3.0
Operating system
Linux
OS version
Linux 5.4.56.bsk.9-amd64 x86_64
Go version
go version go1.18.2 linux/amd64
Relevant log output
Code snippets (optional)
No response
How to Reproduce
Does this issue reproduce with the latest release?
I haven't verified it with the latest release
The text was updated successfully, but these errors were encountered: