|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcore.Connection
core.CBRConnection
public class CBRConnection
A constant bit-rate connection between two DTN nodes.
| Field Summary |
|---|
| Fields inherited from class core.Connection |
|---|
bytesTransferred, fromInterface, fromNode, msgFromNode, msgOnFly, toInterface, toNode |
| Constructor Summary | |
|---|---|
CBRConnection(DTNHost fromNode,
NetworkInterface fromInterface,
DTNHost toNode,
NetworkInterface toInterface,
int connectionSpeed)
Creates a new connection between nodes and sets the connection state to "up". |
|
| Method Summary | |
|---|---|
void |
abortTransfer()
Aborts the transfer of the currently transferred message. |
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 |
double |
getTransferDoneTime()
Gets the transferdonetime |
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. |
| Methods inherited from class core.Connection |
|---|
clearMsgOnFly, finalizeTransfer, getMessage, getOtherInterface, getOtherNode, getTotalBytesTransferred, isInitiator, isReadyForTransfer, isUp, setUpState, update |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CBRConnection(DTNHost fromNode,
NetworkInterface fromInterface,
DTNHost toNode,
NetworkInterface toInterface,
int connectionSpeed)
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 connectionconnectionSpeed - Transfer speed of the connection (Bps) when
the connection is initiated| Method 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 Connectionfrom - The host sending the messagem - The message
MessageRouter.receiveMessage(Message, DTNHost)public void abortTransfer()
abortTransfer in class Connectionpublic double getTransferDoneTime()
public boolean isMessageTransferred()
isMessageTransferred in class Connectionpublic double getSpeed()
getSpeed in class Connectionpublic int getRemainingByteCount()
getRemainingByteCount in class Connectionpublic java.lang.String toString()
toString in class Connection
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||