Package org.jcsp.net2

Class Link.RxLoop

java.lang.Object
org.jcsp.net2.Link.RxLoop
All Implemented Interfaces:
CSProcess
Enclosing class:
Link

final class Link.RxLoop extends Object implements CSProcess
The RxLoop for the Link.
  • Field Details

    • toTxProcess

      private final ChannelOutput toTxProcess
      This is the channel connected to the Link's TX process. We retain this in the RX process for messages such as reject to be sent directly back to the remote node, and to ease the communication mechanism. Any message that requires an acknowledgement has this channel attached to it for simplicity.
    • inputStream

      private final DataInputStream inputStream
      The input stream receiving messages from the opposite remote node
    • incomingEnrolledBarriers

      private final ArrayList incomingEnrolledBarriers
      This is the list of barrier server ends that this Link has received an enroll for. We retain this to allow server ends to be notified when the Link goes down, letting them know that one of the client ends have gone
  • Constructor Details

    • RxLoop

      RxLoop(ChannelOutput out, DataInputStream stream)
      Constructor for the RX part of the Link
      Parameters:
      out - The Channel connected to the TX part of the Link
      stream - The input stream used to receive messages upon
  • Method Details

    • run

      public void run()
      The point here is to try and deal with any message that may come into the Node. This involves a great deal of choice, and therefore this run method looks quite complicated. However, splitting the switch statements into parts should allow a good idea of exactly what is going on.
      Specified by:
      run in interface CSProcess