Pheanstalk\Socket\NativeSocket::getLine PHP Method

getLine() public method

* (non-phpdoc)
See also: Socket::write()
public getLine ( $length = null )
    public function getLine($length = null)
    {
        do {
            $data = isset($length) ? $this->_wrapper()->fgets($this->_socket, $length) : $this->_wrapper()->fgets($this->_socket);
            if ($this->_wrapper()->feof($this->_socket)) {
                throw new Exception\SocketException('Socket closed by server!');
            }
        } while ($data === false);
        return rtrim($data);
    }