作者 邓超

发件代理新增服务器

@@ -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 });