resumeAccept 函数的逻辑看不懂
public function resumeAccept()
{
// Register a listener to be notified when server socket is ready to read.
if (static::$globalEvent && true === $this->_pauseAccept && $this->_mainSocket) {
if ($this->transport !== 'udp') {
static::$globalEvent->add($this->_mainSocket, EventInterface::EV_READ, array($this, 'acceptConnection'));
} else {
static::$globalEvent->add($this->_mainSocket, EventInterface::EV_READ, array($this, 'acceptUdpConnection'));
}
$this->_pauseAccept = false;
}
}
我怎么觉得是
if (static::$globalEvent && flase === $this->_pauseAccept && $this->_mainSocket) {
这样才对 $this->_pauseAccept =ture 不是暂停的吗 都暂停了 还怎么进行
1个回答
年代过于久远,无法发表回答
pause 暂停
resume 继续
若暂停为true,才执行resume
都暂停了 static::$globalEvent->add($this->_mainSocket, EventInterface::EV_READ, array($this, 'acceptConnection')); 这个还起作用吗
_pauseAccept只是一个状态标识,不是真的暂停
好的 谢谢您