Reads from the socket. Does not apply to this implementation.

@return boolean|string
481504
public function read() {
		if (!is_resource($this->_resource)) {
			return false;
		}
		$meta = stream_get_meta_data($this->_resource);
		if (isset($meta['wrapper_data'])) {
			$headers = join("\r\n", $meta['wrapper_data']) . "\r\n\r\n";
		} else {
			$headers = null;
		}
		return $headers . stream_get_contents($this->_resource);
	}
970907
final public function read($byte_count=null)
    {

        $buffer = '';
        $read = array($this->socket);

        $updated = @stream_select($read, $write, $except, 1);

        if ($updated > 0) {
            $data = fread($this->socket, 4096);
            if($data) {
                   $buffer = $data;
            }

        }

        if(!empty($buffer)){
            $this->log('RECEIVED: '.$buffer);
        }

        return $buffer;
    }
1353819
protected function _read() {
        $code = null;
        $len = -1;
        while ( ! feof($this->_varnishConn)) {
            $response = fgets($this->_varnishConn, self::READ_CHUNK_SIZE);
            if (empty($response)) {
                $streamMeta = stream_get_meta_data($this->_varnishConn);
                if ($streamMeta['timed_out']) {
                    Mage::throwException('Varnish admin socket timeout');
                }
            }
            if (preg_match('~^(\d{3}) (\d+)~', $response, $match)) {
                $code = (int) $match[1];
                $len = (int) $match[2];
                break;
            }
        }

        if (is_null($code)) {
            Mage::throwException('Failed to read response code from Varnish');
        } else {
            $response = array('code' => $code, 'text' => '');
            while ( ! feof($this->_varnishConn) &&
                    strlen($response['text']) < $len) {
                $response['text'] .= fgets($this->_varnishConn,
                    self::READ_CHUNK_SIZE);
            }
            return $response;
        }
    }
652099
public function read()
    {
        if (!$this->valid()) {
            return null;
        }

        // keep a local copy of the resource; the next() call could change the cached one
        $resource = $this->resource;

        $item = $this->current();
        $this->next();

        // serialize the item
        $event = new ResourceSerializeEvent($resource, $item);
        $this->eventDispatcher->dispatch(FeedEvents::RESOURCE_PRE_SERIALIZE, $event);
        $item = $this->serialize($item);
        $this->eventDispatcher->dispatch(FeedEvents::RESOURCE_POST_SERIALIZE, $event);

        return $item;
    }
491889
private function readPacket()
    {
        if ($packet = fread($this->_sock, self::HEADER_LEN)) {
            $resp = $this->decodePacketHeader($packet);
            $resp['content'] = '';
            if ($resp['contentLength']) {
                $len  = $resp['contentLength'];
                while ($len && ($buf=fread($this->_sock, $len)) !== false) {
                    $len -= strlen($buf);
                    $resp['content'] .= $buf;
                }
            }
            if ($resp['paddingLength']) {
                $buf = fread($this->_sock, $resp['paddingLength']);
            }
            return $resp;
        } else {
            return false;
        }
    }
44468
public function read()
    {
        $this->ensureDeviceOpen();

        $chars = [];

        do {
            $char = fread($this->fd, 1);
            $chars[] = $char;
        } while ($char != $this->getParser()->getSeparator());

        return $this->getParser()->parse($chars);
    }
1031327
private function read() {

                // Check for a connection
                if( !$this->connection->established ) {
                        $this->connection->establish();
                }

                // Set up the array to use for storing the read in MPD response
                $response = array();

		// This will be used in case there is an empty array as the response
		$ok = false;

		// Get the stream meta-data
                $info = stream_get_meta_data( $this->connection->socket );

		//Log::info('LxMPD->read : stream_get_meta_data for this->connection->socket', array($info));

                // Wait for output to finish or time out
                while( !feof( $this->connection->socket ) && !$info['timed_out'] ) {

			try {

                        $line = trim( fgets( $this->connection->socket ));

			//Log::info('LxMPD->read : line', array($line));

			$info = stream_get_meta_data( $this->connection->socket );

			//Log::info('LxMPD->read : stream_get_meta_data for this->connection->socket', array($info));

                        // We get empty lines sometimes. Ignore them.
                        if( empty( $line ) ) {

                                continue;

                        } else if( strcmp( self::MPD_OK, $line ) == 0 ) {

				$ok = true;
                                break;

                        } else if( strncmp( self::MPD_ERROR, $line, strlen( self::MPD_ERROR ) ) == 0 && preg_match( '/^ACK \[(.*?)\@(.*?)\] \{(.*?)\} (.*?)$/', $line, $matches ) ) {

				// First item in matches will be the errorConstant
				// Second item in matches will be the index of the failed command
				// Third item in matches will be the original command that was run
				// Fourth item in matches will be the error message
				list( $constant, $index, $command, $error ) = $matches;

				Log::info('LxMPD write constant', array($constant));
				//Log::info('LxMPD write index', array($index));
				//Log::info('LxMPD write command', array($command));
				//Log::info('LxMPD write error', array($error));

				throw new MPDException( 'Command failed: '.$error, self::MPD_COMMAND_FAILED );

			} else {

			        $response[] = $line;
                        }

			} catch (Exception $e) {

				Log::info('LxMPD->read : Exception occurred', $e);
			}
                }

                if( $info['timed_out'] ) {

			$this->connection->close();

                        throw new MPDException( 'Command timed out', self::MPD_TIMEOUT );

                } else {

			if( !count($response) ) {

				$response = $ok;
			}

                        return $response;
                }
        }
600131
private function getData()
    {
        $data = fgets($this->socket);
        if ($data === false || $data === '') {
            throw new ConnectionException('Nothing received while reading from client');
        }
        return $data;
    }
630785
protected function readToBuffer()
    {
        $this->ThrowOnConnectionInvalid();
        $message = stream_socket_recvfrom($this->connection, 1024, 0, $peer);
        //$message = fread($conn,1024);
        if ($message !== '' && $message !== false) {
            $this->buffer->pushData($message);
            foreach ($this->buffer->getMessages() as $messageData) {
                $messageData = unserialize($messageData);
                $this->emit('message', array($this, $messageData));
            }
        } else {
            $this->close();
        }
    }
15012
public function getReadHandler()
    {
        if (null === $this->stream) {
            $this->stream = fopen($this->uri, 'r');
        }
        return $this->stream;
    }
1304523
protected function _read($length = null) {
		if (!$this->connected && !$this->connect()) {
			return false;
		}
		if ($length) {
			if (feof($this->_connection)) {
				return false;
			}
			$data = stream_get_contents($this->_connection, $length + 2);
			$meta = stream_get_meta_data($this->_connection);

			if ($meta['timed_out']) {
				$this->_error('Connection timed out.');
				return false;
			}
			$packet = rtrim($data, "\r\n");
		} else {
			$packet = stream_get_line($this->_connection, 16384, "\r\n");
		}
		return $packet;
	}
1071098
public function read()
    {
        $proxy = Helper::getOption('proxy');
        if (is_null($proxy)) {
            $protocol = substr($this->getFeedUrl(), 0, 5)=='https' ? 'https' : 'http';
            $proxy = Helper::getOption('proxy_'.$protocol);
        }

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $this->getFeedUrl());
        if (!is_null($proxy)) {
            curl_setopt($ch, CURLOPT_PROXY, $proxy);
        }
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//        curl_setopt($ch, CURLOPT_HEADER, 1);
        $result = curl_exec($ch);
        curl_close($ch);

        if (!empty($result)) {
            $this->_init($result)->parse();
        }
    }
374878
public function read()
    {
        // First, read headers only
        $response = '';
        $gotStatus = false;
        while (($line = @fgets($this->socket)) !== false) {
            $gotStatus = $gotStatus || (strpos($line, 'HTTP') !== false);
            if ($gotStatus) {
                $response .= $line;
                if (rtrim($line) === '') break;
            }
        }

        $statusCode = Zend_Http_Response::extractCode($response);

        // Handle 100 and 101 responses internally by restarting the read again
        if ($statusCode == 100 || $statusCode == 101) return $this->read();

        /**
         * Responses to HEAD requests and 204 or 304 responses are not expected
         * to have a body - stop reading here
         */
        if ($statusCode == 304 || $statusCode == 204 ||
            $this->method == Zend_Http_Client::HEAD) return $response;

        // Check headers to see what kind of connection / transfer encoding we have
        $headers = Zend_Http_Response::extractHeaders($response);

        // If we got a 'transfer-encoding: chunked' header
        if (isset($headers['transfer-encoding'])) {
            if ($headers['transfer-encoding'] == 'chunked') {
                do {
                    $line  = @fgets($this->socket);
                    $chunk = $line;

                    // Figure out the next chunk size
                    $chunksize = trim($line);
                    if (! ctype_xdigit($chunksize)) {
                        $this->close();
                        require_once 'Zend/Http/Client/Adapter/Exception.php';
                        throw new Zend_Http_Client_Adapter_Exception('Invalid chunk size "' .
                            $chunksize . '" unable to read chunked body');
                    }

                    // Convert the hexadecimal value to plain integer
                    $chunksize = hexdec($chunksize);

                    // Read chunk
                    $left_to_read = $chunksize;
                    while ($left_to_read > 0) {
                        $line = @fread($this->socket, $left_to_read);
                        if ($line === false || strlen($line) === 0)
                        {
                            break;
                        } else {
                            $chunk .= $line;
                            $left_to_read -= strlen($line);
                        }

                        // Break if the connection ended prematurely
                        if (feof($this->socket)) break;
                    }

                    $chunk .= @fgets($this->socket);
                    $response .= $chunk;
                } while ($chunksize > 0);

            } else {
                throw new Zend_Http_Client_Adapter_Exception('Cannot handle "' .
                    $headers['transfer-encoding'] . '" transfer encoding');
            }

        // Else, if we got the content-length header, read this number of bytes
        } elseif (isset($headers['content-length'])) {
            $left_to_read = $headers['content-length'];
            $chunk = '';
            while ($left_to_read > 0) {
                $chunk = @fread($this->socket, $left_to_read);
                if ($chunk === false || strlen($chunk) === 0)
                {
                    break;
                } else {
                    $left_to_read -= strlen($chunk);
                    $response .= $chunk;
                }

                // Break if the connection ended prematurely
                if (feof($this->socket)) break;
            }

        // Fallback: just read the response until EOF
        } else {
        	do {
        		$buff = @fread($this->socket, 8192);
        		if ($buff === false || strlen($buff) === 0)
        		{
        			break;
        		} else {
                    $response .= $buff;
        		}
        	} while (feof($this->socket) === false);

            $this->close();
        }

        // Close the connection if requested to do so by the server
        if (isset($headers['connection']) && $headers['connection'] == 'close') {
            $this->close();
        }

        return $response;
    }
1086752
public function read()
	{
		$this->position++;
		if ( $this->position >= count( $this->buffer ) ) return false;

		return $this->buffer[ $this->position ];
	}
473003
protected function read($socket)
    {
        $result = fgets($socket);
        if ($result === false) {
            throw new \RuntimeException();
        }
        return $this->unserialize($result);
    }
956057
private function readHeader(): self
    {
        if (null !== $this->statusLine) {
            return $this;
        }

        do {
            $this->parseStatusLine($this->socket->readLine());
            $headers = '';
            $line    = '';
            while (!$this->socket->eof() && Http::END_OF_LINE !== $line) {
                $line     = $this->socket->readLine() . Http::END_OF_LINE;
                $headers .= $line;
            }

            $this->headers->append($headers);
        } while ($this->requireContinue());
        return $this;
    }
1246325
public function read()
    {
        $response = $this->api->request('GET', $this->absolutePath());

        return (string) $response->getBody();
    }