protected function _sendCmd($cmd) { $status = $this->_sock->getStatus(); if ($status['eof']) { throw new Exception('Failed to write to socket: connection lost'); } $this->_sock->write($cmd . "\r\n"); $this->_debug("C: {$cmd}"); }