def request(event = nil)

      uri = URI(@announceUrl)
  
      dynamicParams = @dynamicRequestParamsBuilder.call

      params = {}
      params['info_hash'] = CGI.escape(@infoHash)
      params['peer_id'] = dynamicParams.peerId
      params['port'] = dynamicParams.port
      params['uploaded'] = dynamicParams.uploaded.to_s
      params['downloaded'] = dynamicParams.downloaded.to_s
      params['left'] = dynamicParams.left.to_s
      params['compact'] = "1"
      params['no_peer_id'] = "1"
      if ! @startSent
        event = :started  
        @startSent = true
      end
      params['event'] = event.to_s if event
      

      @logger.debug "Request parameters: "
      params.each do |k,v|
        @logger.debug "  #{k}: #{v}"
      end

      query = ""
      params.each do |k,v|
        query  << "&" if query.length > 0
        query  << "#{k}=#{v}"
      end
      uri.query = query
  
      begin
        res = Net::HTTP.get_response(uri)
      rescue Timeout::Error
        return TrackerResponse.new(false, "Tracker request timed out", []) 
      end
      @logger.debug "Tracker response code: #{res.code}"
      @logger.debug "Tracker response body: #{res.body}"
      result = buildTrackerResponse(res)
      @logger.debug "TrackerResponse: #{result.inspect}"
      result 
    end
def request(event = nil)

      uri = URI(@announceUrl)
  
      dynamicParams = @dynamicRequestParamsBuilder.call

      params = {}
      params['info_hash'] = CGI.escape(@infoHash)
      params['peer_id'] = dynamicParams.peerId
      params['port'] = dynamicParams.port
      params['uploaded'] = dynamicParams.uploaded.to_s
      params['downloaded'] = dynamicParams.downloaded.to_s
      params['left'] = dynamicParams.left.to_s
      params['compact'] = "1"
      params['no_peer_id'] = "1"
      if ! @startSent
        event = :started  
        @startSent = true
      end
      params['event'] = event.to_s if event
      

      @logger.debug "Request parameters: "
      params.each do |k,v|
        @logger.debug "  #{k}: #{v}"
      end

      query = ""
      params.each do |k,v|
        query  << "&" if query.length > 0
        query  << "#{k}=#{v}"
      end
      uri.query = query
  
      begin
        res = Net::HTTP.get_response(uri)
      rescue Timeout::Error
        return TrackerResponse.new(false, "Tracker request timed out", []) 
      end
      @logger.debug "Tracker response code: #{res.code}"
      @logger.debug "Tracker response body: #{res.body}"
      result = buildTrackerResponse(res)
      @logger.debug "TrackerResponse: #{result.inspect}"
      result 
    end
Request a list of peers from the tracker and return it as a TrackerResponse.
 Event, if specified, may be set to :started, :stopped, or :completed.
 This is used to notify the tracker that this is the first request,
 that we are shutting down, or that we have the full torrent respectively.
 Not specifying the event just means this is a regular poll.
def getPeers(event = nil)