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

corrected class name in output messages, provide full invocation instructions

parent d71dedb3
No related branches found
No related tags found
No related merge requests found
......@@ -21,14 +21,14 @@ public class AllPduReceiver
DatagramPacket packet;
try {
System.out.println("DisExamplesOpenDis7.PduReceiver started...");
System.out.println("DisExamplesOpenDis7.AllPduReceiver started...");
if (args.length == 2) {
socket = new MulticastSocket(Integer.parseInt(args[0]));
address = InetAddress.getByName(args[1]);
}
else {
System.out.println("Usage: PduReceiver <port> <multicast group>");
System.out.println("Default: PduReceiver " + DEFAULT_MULTICAST_PORT + " " + DEFAULT_MULTICAST_ADDRESS);
System.out.println("Usage: AllPduReceiver <port> <multicast group>");
System.out.println("Default: AllPduReceiver " + DEFAULT_MULTICAST_PORT + " " + DEFAULT_MULTICAST_ADDRESS);
socket = new MulticastSocket(DEFAULT_MULTICAST_PORT);
address = InetAddress.getByName(DEFAULT_MULTICAST_ADDRESS);
}
......@@ -70,11 +70,11 @@ public class AllPduReceiver
}
}
catch (IOException e) {
System.out.println("Problem with DisExamplesOpenDis7.PduReceiver, see exception trace:");
System.out.println("Problem with DisExamplesOpenDis7.AllPduReceiver, see exception trace:");
System.out.println(e);
}
finally {
System.out.println("DisExamplesOpenDis7.PduReceiver complete.");
System.out.println("DisExamplesOpenDis7.AllPduReceiver complete.");
}
}
}
Invocation instructions:
1. run or debug AllPduReceiver.java
2. send PDUs from another program such as AllPduSender.java (shown here)
3. kill process console when complete.
Program response:
===================================================
DisExamplesOpenDis7.PduReceiver started...
Usage: PduReceiver <port> <multicast group>
Default: PduReceiver 3000 239.1.2.3
DisExamplesOpenDis7.AllPduReceiver started...
Usage: AllPduReceiver <port> <multicast group>
Default: AllPduReceiver 3000 239.1.2.3
received DIS PDU 1 ENTITY_STATE of type edu.nps.moves.dis7.EntityStatePdu (protocolFamily ENTITY_INFORMATION_INTERACTION)
received DIS PDU 2 FIRE of type edu.nps.moves.dis7.FirePdu (protocolFamily WARFARE)
received DIS PDU 3 DETONATION of type edu.nps.moves.dis7.DetonationPdu (protocolFamily WARFARE)
......@@ -80,3 +82,4 @@ received DIS PDU 69 ENTITY_DAMAGE_STATUS of type edu.nps.moves.dis
received DIS PDU 70 INFORMATION_OPERATIONS_ACTION of type edu.nps.moves.dis7.InformationOperationsActionPdu (protocolFamily INFORMATION_OPERATIONS)
received DIS PDU 71 INFORMATION_OPERATIONS_REPORT of type edu.nps.moves.dis7.InformationOperationsReportPdu (protocolFamily INFORMATION_OPERATIONS)
received DIS PDU 72 ATTRIBUTE of type edu.nps.moves.dis7.AttributePdu (protocolFamily ENTITY_INFORMATION_INTERACTION)
BUILD STOPPED (total time: 53 seconds)
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