|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcore.Connection
core.VBRConnection
public class VBRConnection
A connection between two DTN nodes. The transmission speed is updated every round from the end point transmission speeds
Field Summary |
---|
Fields inherited from class core.Connection |
---|
bytesTransferred, fromInterface, fromNode, msgFromNode, msgOnFly, toInterface, toNode |
Constructor Summary | |
---|---|
VBRConnection(DTNHost fromNode,
NetworkInterface fromInterface,
DTNHost toNode,
NetworkInterface toInterface)
Creates a new connection between nodes and sets the connection state to "up". |
Method Summary | |
---|---|
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. |
java.lang.String |
toString()
Returns a String presentation of the connection. |
void |
update()
Calculate the current transmission speed from the information given by the interfaces, and calculate the missing data amount. |
Methods inherited from class core.Connection |
---|
abortTransfer, clearMsgOnFly, finalizeTransfer, getMessage, getOtherInterface, getOtherNode, getTotalBytesTransferred, isInitiator, isReadyForTransfer, isUp, setUpState |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public 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 connectionMethod Detail |
---|
public 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 Connection
from
- The host sending the messagem
- The message
MessageRouter.receiveMessage(Message, DTNHost)
public void update()
update
in class Connection
public double getSpeed()
getSpeed
in class Connection
public int getRemainingByteCount()
getRemainingByteCount
in class Connection
public boolean isMessageTransferred()
isMessageTransferred
in class Connection
public java.lang.String toString()
toString
in class Connection
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |