communication
Class ReliableCommElt

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

public class ReliableCommElt
extends CommunicationElement

Reliable communication element: ensure that all data are sent to receivers or, in case of communication problems, throw explicit exceptions. Note: message sending services can take a certain time to execute and to return. This is due to the fact that we must wait to know if a message has been received or not. So, we must wait for the (virtual) transmission delay to be past.


Nested Class Summary
 
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
ReliableCommElt()
          Reliable communication : if the remote element is reachable, ensure it receives data, otherwise generate an explicit error.
ReliableCommElt(int port)
           
 
Method Summary
protected  void physicalSendMessage(Message msg, ProcessIdentifier id)
          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

ReliableCommElt

public ReliableCommElt()
                throws CommunicationException
Reliable communication : if the remote element is reachable, ensure it receives data, otherwise generate an explicit error.

Throws:
CommunicationException

ReliableCommElt

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

physicalSendMessage

protected void physicalSendMessage(Message msg,
                                   ProcessIdentifier id)
                            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)
id - the id of the sender
Throws:
CommunicationException - in case of communication problem