聊天室框架中的getway出现error opcode 7 and close websocket connection.无法连接

bawbaw

下载了workman的 聊天室框架,在运行了2天后,由于客户端连不上,

服务端出现了底下错误
php start.php start

Workerman start in DEBUG mode
----------------------- WORKERMAN -----------------------------
Workerman version:3.3.4          PHP version:5.6.25
------------------------ WORKERS -------------------------------
user          worker           listen                    processes status
root          ChatGateway      websocket://0.0.0.0:7272   4         
----------------------------------------------------------------
Press Ctrl-C to quit. Start success.
error opcode 7 and close websocket connection. Buffer:e728781c
error opcode 7 and close websocket connection. Buffer:c747e8df
error opcode 7 and close websocket connection. Buffer:27ab8170
error opcode 3 and close websocket connection. Buffer:2349ddcd
error opcode 4 and close websocket connection. Buffer:845e8d7b
error opcode 11 and close websocket connection. Buffer:1bd45dc2
error opcode 6 and close websocket connection. Buffer:564d23ed

重启服务后就正常了,请问这要怎解决此类问题?

8251 11 0
11个回答

walkor

客户端问题,客户端传递的数据包不符合websocket协议。

  • 暂无评论
bawbaw

但要重启getway服务端才能连上,客户端传递据方式也是使用框架中的方式传递

  • 暂无评论
walkor

什么客户端?

  • 暂无评论
bawbaw
  • 暂无评论
walkor

浏览器么?版本是?

  • 暂无评论
bawbaw

这个是放上线运行的,有各种浏览器,我再观察下再回报

  • 暂无评论
cjzddii

我的windows版也遇到这个问题 CMD窗口中不定时的出现“error opcode 6 and close websocket connection. ”,客户端是IE11 ,chrome 无此问题。

  • 暂无评论
walkor

感谢反馈,我这边留意下。
看报错是客户端发来的数据不符合websocket协议。
根据楼主的buffer数据看确实是错误的数据。

牛牛小宝

我的是windows版本,线上运行时间一长就会出现这个问题,有的用户能发言,有的用户不能发言,重启一下就好了。

----------------------- WORKERMAN -----------------------------
Workerman version:3.3.2 PHP version:5.3.8
------------------------ WORKERS -------------------------------
worker listen processes status
Register text://0.0.0.0:1238 1
ChatGateway Websocket://0.0.0.0:8282 1
ChatBusinessWorker none 1
ChatBusinessWorker_2 none 1
ChatBusinessWorker_3 none 1
ChatBusinessWorker_4 none 1
RobotBusinessWorker none 1

Press Ctrl-C to quit. Start success.
error opcode 5 and close websocket connection
error opcode 12 and close websocket connection
error opcode 4 and close websocket connection
error opcode 4 and close websocket connection
error opcode 15 and close websocket connection
error opcode 5 and close websocket connection
error opcode 15 and close websocket connection
error opcode 6 and close websocket connection
error opcode 7 and close websocket connection
error opcode 3 and close websocket connection
error opcode 4 and close websocket connection
error opcode 12 and close websocket connection
error opcode 3 and close websocket connection
error opcode 7 and close websocket connection
error opcode 15 and close websocket connection
error opcode 15 and close websocket connection
error opcode 7 and close websocket connection

  • 暂无评论
cjzddii

[attach]396[/attach]
因为传来的opcode貌似不固定 无法判断。请问能不能把源文件中第158行的 $connection->close(); 删除掉 来避免掉线 。删除后是否有影响?

  • 暂无评论
walkor

数据是乱的,不能保持链接

  • 暂无评论
年代过于久远,无法发表回答
🔝