diff --git a/pom.xml b/pom.xml index 466ef02..98dddff 100644 --- a/pom.xml +++ b/pom.xml @@ -263,8 +263,8 @@ io.netty - netty - 4.0.0.Alpha1-SNAPSHOT + netty-all + 4.0.14.Beta1 compile @@ -284,32 +284,4 @@ runtime - - - - - jboss-snapshots - https://repository.jboss.org/nexus/content/repositories/snapshots/ - - true - - - - oss-sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots/ - - true - - - - - - - oss-sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots/ - - true - - - \ No newline at end of file diff --git a/src/main/java/com/torrent4j/model/peer/TorrentPeerInterest.java b/src/main/java/com/torrent4j/model/peer/TorrentPeerInterest.java index f5923f3..78494d7 100644 --- a/src/main/java/com/torrent4j/model/peer/TorrentPeerInterest.java +++ b/src/main/java/com/torrent4j/model/peer/TorrentPeerInterest.java @@ -6,5 +6,13 @@ package com.torrent4j.model.peer; * @author Rogiel */ public enum TorrentPeerInterest { - INTERESTED, NOT_INTERESTED; + /** + * Determines that the peer is interest in any piece from the other peer. + */ + INTERESTED, + + /** + * Determines that the peer is NOT interest in any piece from the other peer. + */ + NOT_INTERESTED; } \ No newline at end of file diff --git a/src/main/java/com/torrent4j/model/peer/TorrentPeerPieces.java b/src/main/java/com/torrent4j/model/peer/TorrentPeerPieces.java index e844171..6fd9f0d 100644 --- a/src/main/java/com/torrent4j/model/peer/TorrentPeerPieces.java +++ b/src/main/java/com/torrent4j/model/peer/TorrentPeerPieces.java @@ -3,11 +3,26 @@ package com.torrent4j.model.peer; import java.util.BitSet; import com.torrent4j.model.AbstractTorrentPiecesContainer; +import com.torrent4j.net.peerwire.messages.BitFieldMessage; +import com.torrent4j.net.peerwire.messages.HaveMessage; - +/** + * This class represents a set of pieces that a given peer has on their side. + * Please note that some peers make use of a delayed bitfield, which sets random + * pieces of the bitfield set on {@link BitFieldMessage} and the rest is + * received with {@link HaveMessage}s. This is called "lazy bitfield". + * + * @author Rogiel + */ public class TorrentPeerPieces extends AbstractTorrentPiecesContainer { private final TorrentPeer peer; - + + /** + * Loads an existing bitset to this container + * + * @param bitSet + * the bitset + */ public void load(BitSet bitSet) { this.bitSet.set(0, this.bitSet.size(), false); for (int i = bitSet.nextSetBit(0); i >= 0; i = bitSet.nextSetBit(i + 1)) {