# File lib/hiredis/ruby/connection.rb, line 263
      def read
        raise "not connected" unless connected?

        while (reply = @reader.gets) == false
          begin
            @reader.feed @sock.read_nonblock(1024)
          rescue Errno::EAGAIN
            if IO.select([@sock], [], [], @timeout)
              # Readable, try again
              retry
            else
              # Timed out, raise
              raise Errno::EAGAIN
            end
          end
        end

        reply
      rescue ::EOFError
        raise Errno::ECONNRESET
      end