public class ConnectionState extends Object
Modifier and Type | Method and Description |
---|---|
Set<Object> |
getCancelledPeerRequests()
Get keys of block requests, that have been cancelled by remote peer.
|
long |
getDownloaded() |
long |
getLastChoked() |
Set<Object> |
getPendingRequests()
Get keys of block requests, that have been sent to the remote peer.
|
Map<Object,CompletableFuture<BlockWrite>> |
getPendingWrites()
Get pending block writes, mapped by keys of corresponding requests.
|
Optional<Boolean> |
getShouldChoke() |
long |
getUploaded() |
void |
incrementDownloaded(long downloaded) |
void |
incrementUploaded(long uploaded) |
boolean |
isChoking() |
boolean |
isInterested() |
boolean |
isPeerChoking() |
boolean |
isPeerInterested() |
void |
onCancel(Cancel cancel)
Signal that remote peer has cancelled a previously issued block request.
|
void |
setInterested(boolean interested) |
void |
setPeerChoking(boolean peerChoking) |
void |
setPeerInterested(boolean peerInterested) |
void |
setShouldChoke(boolean shouldChoke)
Propose choking/unchoking.
|
public boolean isInterested()
public void setInterested(boolean interested)
isInterested()
public boolean isPeerInterested()
public void setPeerInterested(boolean peerInterested)
isPeerInterested()
public boolean isChoking()
public Optional<Boolean> getShouldChoke()
public void setShouldChoke(boolean shouldChoke)
Choker
public long getLastChoked()
public boolean isPeerChoking()
public void setPeerChoking(boolean peerChoking)
isPeerChoking()
public long getDownloaded()
public void incrementDownloaded(long downloaded)
getDownloaded()
public long getUploaded()
public void incrementUploaded(long uploaded)
getUploaded()
public Set<Object> getCancelledPeerRequests()
Mapper.buildKey(int, int, int)
public void onCancel(Cancel cancel)
public Set<Object> getPendingRequests()
Mapper.buildKey(int, int, int)
public Map<Object,CompletableFuture<BlockWrite>> getPendingWrites()
Mapper.buildKey(int, int, int)
Copyright © 2016–2021. All rights reserved.