bt.torrent.messaging.ConnectionState Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bt-core Show documentation
Show all versions of bt-core Show documentation
BitTorrent Client Library (Core)
package bt.torrent.messaging;
import bt.protocol.Cancel;
import bt.protocol.Request;
import bt.torrent.data.BlockWrite;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Optional;
import java.util.Queue;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.LinkedBlockingQueue;
/**
* Contains basic information about a connection's state.
*
* @since 1.0
*/
public class ConnectionState {
private volatile boolean interested;
private volatile boolean peerInterested;
private volatile boolean choking;
private volatile boolean peerChoking;
private volatile long downloaded;
private volatile long uploaded;
private Optional shouldChoke;
private long lastChoked;
private Set