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

关于websocket 握手中 禁止EV_READ选项 #4

Open
pengwang7 opened this issue Dec 12, 2018 · 1 comment
Open

关于websocket 握手中 禁止EV_READ选项 #4

pengwang7 opened this issue Dec 12, 2018 · 1 comment

Comments

@pengwang7
Copy link

哈喽, 我想问一下, 在websocket握手的时候,禁用调用libevent 的EV_READ选项, 如果这个时候客户端断掉连接, 应该不能及时的关闭掉连接, 并且 bufferevent_write向一个关闭的fd去写,也是不会触发异常的,这样连接对应的bufferevent是不是就释放不掉了呢?

@caosiyang
Copy link
Owner

对的,是有这个可能。
代码年代久远,为啥先disable握手完成后再enable,原因也记不清了,可能要处理当时遇到的某个问题吧。
但现在来看处理方式不太对,感觉通过握手状态来控制具体的读写会更好些。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants