Package org.jcsp.net2

Class Link.RxLoop

  • All Implemented Interfaces:
    CSProcess
    Enclosing class:
    Link

    final class Link.RxLoop
    extends java.lang.Object
    implements CSProcess
    The RxLoop for the Link.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.ArrayList incomingEnrolledBarriers
      This is the list of barrier server ends that this Link has received an enroll for.
      private java.io.DataInputStream inputStream
      The input stream receiving messages from the opposite remote node
      private ChannelOutput toTxProcess
      This is the channel connected to the Link's TX process.
    • Constructor Summary

      Constructors 
      Constructor Description
      RxLoop​(ChannelOutput out, java.io.DataInputStream stream)
      Constructor for the RX part of the Link
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void run()
      The point here is to try and deal with any message that may come into the Node.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • 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 java.io.DataInputStream inputStream
        The input stream receiving messages from the opposite remote node
      • incomingEnrolledBarriers

        private final java.util.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 Detail

      • RxLoop

        RxLoop​(ChannelOutput out,
               java.io.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 Detail

      • 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