public class BulkTransmitter
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
BulkTransmitter.AllSentCallback |
Constructor and Description |
---|
BulkTransmitter(PartiallyReceivedBulk prb,
PeerContext peer,
long uid,
boolean noWait,
ByteCounter ctr,
boolean realTime) |
BulkTransmitter(PartiallyReceivedBulk prb,
PeerContext peer,
long uid,
boolean noWait,
ByteCounter ctr,
boolean realTime,
BulkTransmitter.AllSentCallback cb)
Create a bulk data transmitter.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel(java.lang.String reason) |
void |
completed()
Like cancel(), but without the negative overtones: The client says it's got everything,
we believe them (even if we haven't sent everything; maybe they had a partial).
|
java.lang.String |
getCancelReason() |
void |
onAborted()
Called when the PRB is aborted.
|
boolean |
send()
Send the file.
|
java.lang.String |
toString() |
static long[] |
transferSuccess() |
public BulkTransmitter(PartiallyReceivedBulk prb, PeerContext peer, long uid, boolean noWait, ByteCounter ctr, boolean realTime) throws DisconnectedException
DisconnectedException
public BulkTransmitter(PartiallyReceivedBulk prb, PeerContext peer, long uid, boolean noWait, ByteCounter ctr, boolean realTime, BulkTransmitter.AllSentCallback cb) throws DisconnectedException
prb
- The PartiallyReceivedBulk containing the file we want to send, or the part of it that we have so far.peer
- The peer we want to send it to.uid
- The unique identifier for this data transfernoWait
- If true, don't wait for an FNPBulkReceivedAll, return as soon as we've sent everything.DisconnectedException
- If the peer we are trying to send to becomes disconnected.public void onAborted()
public void cancel(java.lang.String reason)
public void completed()
public boolean send() throws DisconnectedException
DisconnectedException
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getCancelReason()
public static long[] transferSuccess()