|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object peersim.transport.UnreliableTransport
public final class UnreliableTransport
This transport protocol can be combined with other transports to simulate message losses. Its behavior is the following: each message can be dropped based on the configured probability, or it will be sent using the underlying transport protocol.
The memory requirements are minimal, as a single instance is created and inserted in the protocol array of all nodes (because instances have no state that depends on the hosting node).
Parameter Summary | |
---|---|
transport
The name of the underlying transport protocol. |
|
drop
String name of the parameter used to configure the probability that a message sent through this transport is lost. |
Constructor Summary | |
---|---|
UnreliableTransport(java.lang.String prefix)
Reads configuration parameter. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns this . |
long |
getLatency(Node src,
Node dest)
Returns the latency of the underlying protocol. |
void |
send(Node src,
Node dest,
java.lang.Object msg,
int pid)
Sends the message according to the underlying transport protocol. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Parameter Detail |
---|
transport
drop
Constructor Detail |
---|
public UnreliableTransport(java.lang.String prefix)
Method Detail |
---|
public java.lang.Object clone()
this
. This way only one instance exists in the system
that is linked from all the nodes. This is because this protocol has no
state that depends on the hosting node.
clone
in interface Protocol
clone
in class java.lang.Object
public void send(Node src, Node dest, java.lang.Object msg, int pid)
send
in interface Transport
src
- sender nodedest
- destination nodemsg
- message to be sentpid
- protocol identifierpublic long getLatency(Node src, Node dest)
getLatency
in interface Transport
src
- sender nodedest
- destination node
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |