communication
Class UnreliableCommElt

java.lang.Object
  extended by communication.CommunicationElement
      extended by communication.UnreliableCommElt
All Implemented Interfaces:
ICommunication

public class UnreliableCommElt
extends CommunicationElement

Unreliable element: send a message without the possibility to know if it has been received by the other element or has been lost.


Nested Class Summary
protected  class UnreliableCommElt.Sender
          Thread that wait a given delay before sending a message
 
Nested classes/interfaces inherited from class communication.CommunicationElement
CommunicationElement.Receiver
 
Field Summary
 
Fields inherited from class communication.CommunicationElement
crashLevel, debugFault, msgBuffer, myPid, packetLostLevel, randGen, tcp, transmissionDelayLowerBound, transmissionDelayUpperBound
 
Constructor Summary
UnreliableCommElt()
           
UnreliableCommElt(int port)
           
 
Method Summary
protected  void physicalSendMessage(Message msg, ProcessIdentifier senderId)
          Method called to "physically" send a message through TCP sockets.
 
Methods inherited from class communication.CommunicationElement
asynchReceiveMessage, availableMessage, crashProcess, getCrashLevel, getMyPid, getPacketLostLevel, getTransmissionDelayLowerBound, getTransmissionDelayUpperBound, isDebugFault, isPacketLost, sendMessage, sendMessage, setCrashLevel, setDebugFault, setMyPid, setPacketLostLevel, setTransmissionDelayLowerBound, setTransmissionDelayUpperBound, synchReceiveMessage, transmissionDelay
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnreliableCommElt

public UnreliableCommElt()
                  throws CommunicationException
Throws:
CommunicationException

UnreliableCommElt

public UnreliableCommElt(int port)
                  throws CommunicationException
Parameters:
port -
Throws:
CommunicationException
Method Detail

physicalSendMessage

protected void physicalSendMessage(Message msg,
                                   ProcessIdentifier senderId)
                            throws CommunicationException
Description copied from class: CommunicationElement
Method called to "physically" send a message through TCP sockets. Will be specialized in ReliableCommElt and UnreliableCommElt depending on the reliability policy.

Specified by:
physicalSendMessage in class CommunicationElement
Parameters:
msg - the message to be sent (including the receiver id)
senderId - the id of the sender
Throws:
CommunicationException - in case of communication problem