正在显示
1 个修改的文件
包含
3 行增加
和
1 行删除
| @@ -85,7 +85,9 @@ class ProxyService | @@ -85,7 +85,9 @@ class ProxyService | ||
| 85 | 85 | ||
| 86 | //监听连接关闭事件。 | 86 | //监听连接关闭事件。 |
| 87 | $server->on('Close', function ($server, $fd) { | 87 | $server->on('Close', function ($server, $fd) { |
| 88 | - echo '连接关闭了 => '.$fd."\n"; | 88 | + if(!empty($this->clients[$fd])) { |
| 89 | + echo '关闭连接 => ' . $fd . " 剩余 ".count($this->clients)." 个链接\n"; | ||
| 90 | + } | ||
| 89 | $this->clients[$fd] = null; | 91 | $this->clients[$fd] = null; |
| 90 | unset($this->clients[$fd]); | 92 | unset($this->clients[$fd]); |
| 91 | }); | 93 | }); |
-
请 注册 或 登录 后发表评论