public SharingPeer(String ip, int port, ByteBuffer peerId,
			SharedTorrent torrent) {
		super(ip, port, peerId);

		this.torrent = torrent;
		this.listeners = new HashSet<PeerActivityListener>();
		this.availablePieces = new BitSet(this.torrent.getPieceCount());
		this.exchangeLock = new Object();

		this.reset();
		this.requestedPiece = null;
	}