Skip to content
Snippets Groups Projects
Commit f4978356 authored by brutzman's avatar brutzman
Browse files

corrected class name in output messages, provide full invocation instructions and log

parent 0adae1cd
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ import java.util.Scanner;
*/
public class PduListenerSaver
{
private final static String DEFAULT_OUTPUTDIR = "./pduLog";
private final static String DEFAULT_OUTPUTDIR = "pduLog";
private final static String MCAST_ADDR = "239.1.2.3";
private final static int DIS_PORT = 3000;
......@@ -32,6 +32,8 @@ public class PduListenerSaver
String outDir = DEFAULT_OUTPUTDIR;
String mcast = MCAST_ADDR;
int port = DIS_PORT;
System.out.println("DisExamplesOpenDis7.PduListenerSaver started...");
switch (args.length) {
case 0:
......@@ -55,6 +57,7 @@ public class PduListenerSaver
recorder.startResume();
mystate state = mystate.RUNNING;
System.out.println("* recorder.startResume(), state=RUNNING");
Scanner scan = new Scanner(System.in);
while (true) {
......@@ -63,20 +66,23 @@ public class PduListenerSaver
if (line.equalsIgnoreCase("p") && state == mystate.RUNNING) {
recorder.stopPause();
state = mystate.PAUSED;
System.out.println("* recorder.stopPause(), state=PAUSED");
}
else if (line.equalsIgnoreCase("r") && state == mystate.PAUSED) {
recorder.startResume();
state = mystate.RUNNING;
System.out.println("* recorder.startResume(), state=RUNNING");
}
else if (line.equalsIgnoreCase("q")) {
recorder.end();
System.out.println("* recorder.end(), recording complete.");
break;
}
}
System.out.println("Ending pdu save to "+recorder.getLogFile());
}
catch (IOException ex) {
System.err.println("Exception: " + ex.getClass().getSimpleName() + ": " + ex.getLocalizedMessage());
System.err.println("*** Exception: " + ex.getClass().getSimpleName() + ": " + ex.getLocalizedMessage());
}
}
}
Invocation instructions:
1. run or debug PduListenerSaver.java
2. send PDUs from another program such as AllPduSender.java (used here)
3. also running AllPduReceiver can confirm that DIS replay actually occurs.
4. Type p/enter to pause, r/enter to resume, q/enter to quit
5. if Pdusave.dislog file(s) already exist, your recording will be added.
6. note existence of recorded files in directory, e.g. examples/pduLog/Pdusave.dislog
7. rename/cut/paste your recording file to keep track of your results.
Program response:
===================================================
DisExamplesOpenDis7.PduListenerSaver started...
Beginning pdu save to directory pduLog
* recorder.startResume(), state=RUNNING
Type p/enter to pause, r/enter to resume, q/enter to quit
q
Recorder log file closed
* recorder.end(), recording complete.
Ending pdu save to C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\pduLog\Pdusave1.dislog
BUILD SUCCESSFUL (total time: 1 minute 51 seconds)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment