-
Notifications
You must be signed in to change notification settings - Fork 194
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
客户端发出主动关闭请求时无法触发onClose #78
Labels
bug
Something isn't working
Comments
这边确实有问题,ShutdownWrite 方法内部理论上不需要 c.connected.Set(false),这样也就应该没有这个问题了。 |
如果你有空,可以在 PR 加个单测复现下这个问题,应该删除这行就可以 Fix 这个问题了 Line 142 in 7ac1dc1
|
Merged
@cs-charles 这个bug 已经修复了,感谢指出 |
rfyiamcool
pushed a commit
to rfyiamcool/gev
that referenced
this issue
Apr 26, 2021
* Fix Allenxuxu#78 && add unit test
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
在案例控制服务端的最大连接数代码中,通过OnConnect事件和onClose事件来控制链接计数器。经本人测试后,如果是客户端发送header.OpCode为ws.OpClose后,服务端会调用c.ShutdownWrite()方法来关闭连接,同时设置c.connected.Set(false)。而onClose方法在响应关闭连接的事件回调后会触发如下逻辑,由于c.connected在前面已经被设置成了false,所以并不会执行onClose()方法。导致服务端的连接计数器不准确。
The text was updated successfully, but these errors were encountered: