public class BlockTransmitter
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
BlockTransmitter.BlockTimeCallback |
static interface |
BlockTransmitter.BlockTransmitterCompletion |
static interface |
BlockTransmitter.ReceiverAbortHandler |
Modifier and Type | Field and Description |
---|---|
static BlockTransmitter.ReceiverAbortHandler |
ALWAYS_CASCADE |
static BlockTransmitter.ReceiverAbortHandler |
NEVER_CASCADE |
static int |
SEND_TIMEOUT |
Constructor and Description |
---|
BlockTransmitter(MessageCore usm,
Ticker ticker,
PeerContext destination,
long uid,
PartiallyReceivedBlock source,
ByteCounter ctr,
BlockTransmitter.ReceiverAbortHandler abortHandler,
BlockTransmitter.BlockTransmitterCompletion callback,
boolean realTime,
BlockTransmitter.BlockTimeCallback blockTimes) |
Modifier and Type | Method and Description |
---|---|
void |
abortSend(int reason,
java.lang.String desc)
Abort the send, and then send the sendAborted message.
|
void |
callCallback(boolean success) |
PeerContext |
getDestination() |
static int |
getRunningSends() |
void |
innerSendAborted(int reason,
java.lang.String desc) |
boolean |
maybeAllSent()
LOCKING: Must be called with _senderThread held.
|
boolean |
maybeComplete()
Complete? maybeAllSent() must have already returned true.
|
freenet.io.xfer.BlockTransmitter.Future |
maybeFail(int reason,
java.lang.String description)
Only fail once.
|
void |
scheduleTimeoutAfterBlockSends() |
void |
sendAsync()
Send the data, off-thread.
|
java.lang.String |
toString() |
public static final int SEND_TIMEOUT
public static final BlockTransmitter.ReceiverAbortHandler ALWAYS_CASCADE
public static final BlockTransmitter.ReceiverAbortHandler NEVER_CASCADE
public BlockTransmitter(MessageCore usm, Ticker ticker, PeerContext destination, long uid, PartiallyReceivedBlock source, ByteCounter ctr, BlockTransmitter.ReceiverAbortHandler abortHandler, BlockTransmitter.BlockTransmitterCompletion callback, boolean realTime, BlockTransmitter.BlockTimeCallback blockTimes)
public void scheduleTimeoutAfterBlockSends()
public boolean maybeAllSent()
public boolean maybeComplete()
public freenet.io.xfer.BlockTransmitter.Future maybeFail(int reason, java.lang.String description)
public void abortSend(int reason, java.lang.String desc) throws NotConnectedException
NotConnectedException
public void innerSendAborted(int reason, java.lang.String desc) throws NotConnectedException
NotConnectedException
public void sendAsync()
public void callCallback(boolean success)
public PeerContext getDestination()
public java.lang.String toString()
toString
in class java.lang.Object
public static int getRunningSends()