public class SSKInsertSender extends BaseSender implements PrioRunnable, AnyInsertSender, ByteCounter
dontDecrementHTLThisTime, gotMessages, hasForwarded, htl, lastMessage, lastNode, nodesRoutedTo, origHTL, rejectOverloads, routeAttempts| Modifier and Type | Method and Description |
|---|---|
protected Message |
createDataRequest() |
protected void |
forwardRejectedOverload()
Forward RejectedOverload to the request originator.
|
protected long |
getAcceptedTimeout() |
SSKBlock |
getBlock() |
byte[] |
getData() |
byte[] |
getHeaders() |
short |
getHTL() |
int |
getPriority() |
byte[] |
getPubkeyHash() |
PeerNode[] |
getRoutedTo() |
int |
getStatus() |
java.lang.String |
getStatusString() |
static java.lang.String |
getStatusString(int status) |
int |
getTotalReceivedBytes() |
int |
getTotalSentBytes() |
long |
getUID() |
protected void |
handleAcceptedRejectedTimeout(PeerNode next,
UIDTag tag) |
boolean |
hasCollided() |
boolean |
hasRecentlyCollided() |
protected long |
ignoreLowBackoff() |
protected boolean |
isAccepted(Message msg) |
protected boolean |
isInsert() |
protected MessageFilter |
makeAcceptedRejectedFilter(PeerNode next,
long acceptedTimeout,
UIDTag tag)
Construct a filter to wait the specified time for accepted or rejected.
|
protected void |
onAccepted(PeerNode next) |
void |
receivedBytes(int x) |
protected void |
routeRequests()
The main route requests loop.
|
void |
run() |
void |
sentBytes(int x)
Sent some bytes.
|
void |
sentPayload(int x)
Sent payload - only include the number of bytes of actual payload i.e.
|
boolean |
sentRequest() |
protected PeerNode |
sourceForRouting() |
protected void |
timedOutWhileWaiting(double load)
We timed out while waiting for a slot from any node.
|
java.lang.String |
toString() |
calculateTimeout, calculateTimeout, getLongSlotWaiterTimeout, getShortSlotWaiterTimeout, hopsForFatalTimeoutWaitingForPeer, innerRouteRequests, innerRouteRequestsNew, innerRouteRequestsOld, routedLast, timeSinceSentpublic void run()
run in interface java.lang.Runnableprotected void routeRequests()
BaseSenderrouteRequests in class BaseSenderprotected void handleAcceptedRejectedTimeout(PeerNode next, UIDTag tag)
handleAcceptedRejectedTimeout in class BaseSenderprotected MessageFilter makeAcceptedRejectedFilter(PeerNode next, long acceptedTimeout, UIDTag tag)
BaseSendermakeAcceptedRejectedFilter in class BaseSendernext - The peer we are waiting for a response from.acceptedTimeout - The time to wait.tag - Use the UID from this tag. Some requests may change the tag
after some hops, and if e.g. waiting for confirmation after a timeout,
we need to use the old tag.protected void forwardRejectedOverload()
forwardRejectedOverload in class BaseSenderpublic int getStatus()
getStatus in interface AnyInsertSenderpublic short getHTL()
getHTL in interface AnyInsertSenderpublic java.lang.String getStatusString()
getStatusString in interface AnyInsertSenderpublic static java.lang.String getStatusString(int status)
public boolean sentRequest()
sentRequest in interface AnyInsertSenderpublic boolean hasRecentlyCollided()
public boolean hasCollided()
public byte[] getPubkeyHash()
public byte[] getHeaders()
public byte[] getData()
public SSKBlock getBlock()
public long getUID()
getUID in interface AnyInsertSenderpublic void sentBytes(int x)
ByteCountersentBytes in interface ByteCounterpublic int getTotalSentBytes()
public void receivedBytes(int x)
receivedBytes in interface ByteCounterpublic int getTotalReceivedBytes()
public void sentPayload(int x)
ByteCountersentPayload in interface ByteCounterx - Number of bytes sentpublic int getPriority()
getPriority in interface PrioRunnablepublic java.lang.String toString()
toString in class java.lang.Objectpublic PeerNode[] getRoutedTo()
protected Message createDataRequest()
createDataRequest in class BaseSenderprotected long getAcceptedTimeout()
getAcceptedTimeout in class BaseSenderprotected void timedOutWhileWaiting(double load)
BaseSendertimedOutWhileWaiting in class BaseSenderload - The proportion of requests getting timed out, on average,
across the nodes we are waiting for. This is used to decide how long the
RecentlyFailed should be for.protected boolean isAccepted(Message msg)
isAccepted in class BaseSenderprotected void onAccepted(PeerNode next)
onAccepted in class BaseSenderprotected boolean isInsert()
isInsert in class BaseSenderprotected PeerNode sourceForRouting()
sourceForRouting in class BaseSenderprotected long ignoreLowBackoff()
ignoreLowBackoff in class BaseSender