沒有人反饋過這個問題。 看下是不是改動了workerman或者gatewayWorker源碼。 這個計數(shù)是在 ConnectionInterface::$statistics['connection_count']計數(shù)的,在 TcpConnection 和 AsyncTcpConnection 構造函數(shù)里加1,在析構函數(shù)里減1。不應該出現(xiàn)負數(shù)的情況,你可以在二者的構造函數(shù)和析構函數(shù)里打下日志,看下是否有問題。
ConnectionInterface::$statistics['connection_count']