-
Notifications
You must be signed in to change notification settings - Fork 77
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 examples #16
Comments
Could share some example code? |
run main func in file:websocket/server/websocket.go. |
大佬是 同胞吗?这个问题应该是 因为 wsutil.ReadClientData 是阻塞读取 conn 里的缓冲区数据。但是gnet OnTraffic 事件的处理协程和 从socket 中读取数据写入conn缓冲区是同一个协程。这就导致了 在 OnTraffic 方法里通过 wsutil.ReadClientData 读取 ws 数据的时候一旦缓冲区的数据不完整 当前协程就被阻塞卡死了。没办法从socket 中继续读取数据写入到 conn的缓冲区 |
如果是阻塞操作的话那确实不能放到 OnTraffic 里执行,你修复了这个问题吗?如果有时间麻烦提交一个 PR,谢谢。 |
There is a problem parsing WS data when the current frame is split into multiple fragments!
The text was updated successfully, but these errors were encountered: