@Override
	public void run() {
		logger.info("Starting announce thread for " +
				torrent.getName() + " to " +
				torrent.getAnnounceUrl() + "...");

		// Set an initial announce interval to 5 seconds. This will be updated
		// in real-time by the tracker's responses to our announce requests.
		this.interval = 5;
		this.initial = true;

		while (!this.stop) {
			this.announce(this.initial ?
					AnnounceEvent.STARTED :
					AnnounceEvent.NONE);

			try {
				logger.trace("Sending next announce in " + this.interval +
					   	" seconds.");
				Thread.sleep(this.interval * 1000);
			} catch (InterruptedException ie) {
				// Ignore
			}
		}

		if (!this.forceStop) {
			// Send the final 'stopped' event to the tracker after a little
			// while.
			try {
				Thread.sleep(500);
			} catch (InterruptedException ie) {
				// Ignore
			}

			this.announce(AnnounceEvent.STOPPED, true);
		}
	}