public class VBRConnection extends Connection
bytesTransferred, fromInterface, fromNode, msgFromNode, msgOnFly, toInterface, toNode| Constructor and Description |
|---|
VBRConnection(DTNHost fromNode,
NetworkInterface fromInterface,
DTNHost toNode,
NetworkInterface toInterface)
Creates a new connection between nodes and sets the connection
state to "up".
|
| Modifier and Type | Method and Description |
|---|---|
int |
getRemainingByteCount()
Returns the amount of bytes to be transferred before ongoing transfer
is ready or 0 if there's no ongoing transfer or it has finished
already
|
double |
getSpeed()
returns the current speed of the connection
|
boolean |
isMessageTransferred()
Returns true if the current message transfer is done.
|
int |
startTransfer(DTNHost from,
Message m)
Sets a message that this connection is currently transferring.
|
void |
update()
Calculate the current transmission speed from the information
given by the interfaces, and calculate the missing data amount.
|
abortTransfer, clearMsgOnFly, finalizeTransfer, getMessage, getOtherInterface, getOtherNode, getTotalBytesTransferred, isInitiator, isReadyForTransfer, isTransferring, isUp, setUpState, toStringpublic VBRConnection(DTNHost fromNode, NetworkInterface fromInterface, DTNHost toNode, NetworkInterface toInterface)
fromNode - The node that initiated the connectionfromInterface - The interface that initiated the connectiontoNode - The node in the other side of the connectiontoInterface - The interface in the other side of the connectionpublic int startTransfer(DTNHost from, Message m)
Connection.finalizeTransfer() and
isMessageTransferred() will not work either). Only a one message
at a time can be transferred using one connection.startTransfer in class Connectionfrom - The host sending the messagem - The messageMessageRouter.receiveMessage(Message, DTNHost)public void update()
update in class Connectionpublic double getSpeed()
getSpeed in class Connectionpublic int getRemainingByteCount()
getRemainingByteCount in class Connectionpublic boolean isMessageTransferred()
isMessageTransferred in class Connection