_readResponse = $str; } /** * Set the write response * * @param mixed $resp * @return void */ public function setWriteResponse($resp) { $this->_writeResponse = $resp; } /** * Connect * * @return true */ protected function _connect($uri) { return true; } /** * Return Response * * @param string $length * @return string */ protected function _read($length) { $ret = substr($this->_readResponse, 0, $length); $this->_readResponse = null; return $ret; } /** * Write and Return Length * * @param string $payload * @return int */ protected function _write($payload) { $ret = $this->_writeResponse; $this->_writeResponse = null; return (null === $ret) ? strlen($payload) : $ret; } }