-
Notifications
You must be signed in to change notification settings - Fork 2
4.1.2 One to One Test Code Documentation
Runs the generalized test cycle, then writes the results out to file. Its constructor is called with the Sender, and the input and output files. Because of that, it's one time use only. The test method is called with the number of repetitions to execute. 0 is inconsistent.
Is an interface for the senders. Its send function is called with the file to send, and the number of times it should be sent. Its kill function makes it let of all its reserved resources. And has a function to get the timestamps out.
Is an interface for the receivers. Its start function starts its thread, and its kill function makes it let of all its reserved resources and stops the thread.
Contains the constants, so they can be changed in one place.
The unified starter creates the receivers, and then runs the test cycles, the receiver starter only creates the receivers, and the sender starter only starts the test cycles. Note that senders are destroyed and remade each test cycle.
First, the receiver registers in the Service Registry.
Because it doesn't unregister EoL, this will probably cause an exception, but it handles it. Note, that because the Sender only tries to connect to the first provider it receives orchestration for of, if you change the key only, the Sender will try to connect to, the now nonexistent, old one, and fail. For this, clean the arrowhead_systems table in the database, or unregister from code.
Then the receiver provides a TCP connection server using the java.net ServerSocket, on the port specified in COnstants.
Then the sender ask for Orchestration, and receives, for the purposes of this test, only the one address and port of the receiver. It opens a connection to the receiver using java.net Socket. The first 8 bytes of the stream will be the size of the file. The receiver will read the stream until it receives that much data, then responds with whatever. When this acknowledge is received by the sender, it timestamps, dismantles the TCP connection, and starts again.
The DdsFile, DdsFileDataReader, DdsFileDataWriter, DdsFileSeq, DdsFileTypeCode, DdsFileTypeSupport are automatically generated by the RTI Code Generator, from and IDL file, which only contained a sequence of octets 64000 bytes long.
This system has two topics, one for sending the file, the other is for the acknowledge. The system sends the file in chunks of 64000 bytes. The first 8 bytes of the first chunk are the size of the file. The receiver only sends the acknowledge when it received that much data.
This system has two topics, one for sending the file, the other is for the acknowledge. The system sends the file as one, massive, byte array. The receiver publishes the acknowledge message to the acknowledge topic whet it receives the message.