gnet-io / gnet-examples

Examples of gnet
MIT License
245 stars 77 forks source link

Some bugs are in websocket #15

Open anotheros opened 2 years ago

anotheros commented 2 years ago

你好, 我发现 websocket 在客户端发送数据过快的时候,服务器端会出现问题。

出现问题代码 在

应该是 github.com/gobwas/ws 在epoll 的下,读取数据导致的。

也许这个bug我该 提给 github.com/gobwas/ws 。

我看了一眼 https://github.com/gnet-io/gnet-examples/blob/v2/simple_protocol/protocol/proto.go 估计要想让 gnet完美支持 websocket ,需要自己写 codec 。

panjf2000 commented 2 years ago

能具体描述下 bug 的表现吗?

anotheros commented 2 years ago

运行这个 https://github.com/gnet-io/gnet-examples/pull/15 。即可复现。

应该是读取 websocket 帧的时候,读了一半。