Ejemplo n.º 1
0
 /**
  * Build the announce request tracker message.
  *
  * @param event The announce event (can be <tt>NONE</tt> or <em>null</em>)
  * @return Returns an instance of a {@link HTTPAnnounceRequestMessage} that can be used to
  *     generate the fully qualified announce URL, with parameters, to make the announce request.
  * @throws UnsupportedEncodingException
  * @throws IOException
  * @throws MessageValidationException
  */
 private HTTPAnnounceRequestMessage buildAnnounceRequest(AnnounceRequestMessage.RequestEvent event)
     throws UnsupportedEncodingException, IOException, MessageValidationException {
   // Build announce request message
   return HTTPAnnounceRequestMessage.craft(
       this.torrent.getInfoHash(),
       this.peer.getPeerId().array(),
       this.peer.getPort(),
       this.torrent.getUploaded(),
       this.torrent.getDownloaded(),
       this.torrent.getLeft(),
       true,
       false,
       event,
       this.peer.getIp(),
       AnnounceRequestMessage.DEFAULT_NUM_WANT);
 }