... new XSException('No server connection'); } if ($this->_flag & self::BROKEN) { throw new XSException('Broken server connection'); }} 检测服务端的连接情况
...conn){ $this->close(); $this->_conn = $conn; $this->_flag = self::BROKEN; $this->_sendBuffer = ''; $this->_project = null; $this->connect(); $this->_flag ^= self::BROKEN; if ($this->xs instanceof XS) { $this->setProject($this->xs->getName()); }} 打开服务端...
...ction close($ioerr = false){ if ($this->_sock && !($this->_flag & self::BROKEN)) { if (!$ioerr && $this->_sendBuffer !== '') { $this->write($this->_sendBuffer); $this->_sendBuffer = ''; } if (!$ioerr && !($this->_flag & self::FILE)) { $cmd = n...
...示) public function reopen($force = false){ if ($this->_flag & self::BROKEN || $force === true) { $this->open($this->_conn); } return $this;} 重新打开连接 仅应用于曾经成功打开的连并且异常关闭了
...{ // check socket if ($this->_sock === null || $this->_flag & (self::BROKEN | self::FILE)) { return false; } $wfds = $xfds = array(); $rfds = array($this->_sock); $res = stream_select($rfds, $wfds, $xfds, 0, 0); return $res > 0;} 判断服务端是否有可读数据 ...
... new XSException('No server connection'); } if ($this->_flag & self::BROKEN) { throw new XSException('Broken server connection'); }} 检测服务端的连接情况 close() 方法 public void close(bool $ioerr=false) $ioerr bool 关闭调用是否由于 IO 错误...