def read(timeout=nil)
      timeout = read_timeout if timeout.nil?
      raw_data = nil

      Timeout.timeout(timeout) do
        raw_data = @socket.gets.chomp
      end

      if (data = parse_raw_data(raw_data))
        data[1]
      else
        raise VLC::ProtocolError, "could not interpret the playload: #{raw_data}"
      end
    rescue Timeout::Error
      raise VLC::ReadTimeoutError, "read timeout"
    end
def read(timeout=nil)
      timeout = read_timeout if timeout.nil?
      raw_data = nil

      Timeout.timeout(timeout) do
        raw_data = @socket.gets.chomp
      end

      if (data = parse_raw_data(raw_data))
        data[1]
      else
        raise VLC::ProtocolError, "could not interpret the playload: #{raw_data}"
      end
    rescue Timeout::Error
      raise VLC::ReadTimeoutError, "read timeout"
    end
Reads data from the TCP server

 @param timeout read timeout value for a read operation.
                If omited the configured value or DEFAULT_READ_TIMEOUT will be used.


 @return [String] the data