Package org.jcsp.net2
Class Link.RxLoop
java.lang.Object
org.jcsp.net2.Link.RxLoop
- All Implemented Interfaces:
CSProcess
- Enclosing class:
- Link
The RxLoop for the Link.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ArrayList
This is the list of barrier server ends that this Link has received an enroll for.private final DataInputStream
The input stream receiving messages from the opposite remote nodeprivate final ChannelOutput
This is the channel connected to the Link's TX process. -
Constructor Summary
ConstructorsConstructorDescriptionRxLoop
(ChannelOutput out, DataInputStream stream) Constructor for the RX part of the Link -
Method Summary
Modifier and TypeMethodDescriptionvoid
run()
The point here is to try and deal with any message that may come into the Node.
-
Field Details
-
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
The input stream receiving messages from the opposite remote node -
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 Linkstream
- 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.
-