断开链接回调onClose,链接数和定时器数没有变

suunnn

workerman客户端断开链接后,onClose()方法也正常调用了,但是status查看connections数和timers数没有减少,依然没有变

2354 2 0
2个回答

suunnn

Workerman version:3.5.4 PHP version:5.6.35
start time:2018-08-24 14:38:18 run 0 days 0 hours
load average: 0, 0, 0 event-loop:\Workerman\Events\Select
1 workers 4 processes
worker_name exit_status exit_count
none 0 0
----------------------------------------------PROCESS STATUS---------------------------------------------------
pid memory listening worker_name connections send_fail timers total_request qps status
21823 2.75M websocket://0.0.0.0:2346 none 0 0 1 0 0
21824 2.75M websocket://0.0.0.0:2346 none 0 0 1 0 0
21825 3.5M websocket://0.0.0.0:2346 none 3 0 4 13 0
21826 2.75M websocket://0.0.0.0:2346 none 0 0 1 0 0

  • 暂无评论
walkor

可能是客户端重连了,另外onClose和定时器减少没有必然联系

  • suunnn 2018-08-28

    客户端断开后确实没有重连,connections数没有减少。“onClose和定时器减少没有必然联系”,明白了,那我需要在客户端断开连接后手动删除和客户端有关的定时器。

  • walkor 2018-08-28

    你看下是不是把$connection保存在哪里了,导致了对象没有被释放,如果你有用数组保存$connection对象,记得onClose后要把对应的$connection删除

年代过于久远,无法发表回答
🔝