Skip to content
Snippets Groups Projects
Commit 1a278171 authored by jonathanboron's avatar jonathanboron
Browse files

HW4 complete, final javadocs

parent b9a4f9cf
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,14 @@ import edu.nps.moves.dis7.enumerations.*;
import static edu.nps.moves.dis7.enumerations.DISPDUType.*;
import edu.nps.moves.dis7.util.*;
/**
* Listens for packets sent to multicast address. Currently formatted to print entity
* location if an entity state PDU is received.
*
* @author jonathanboron
* @version 1.3
*/
public class BoronPduReceiver
{
public static final int DEFAULT_MULTICAST_PORT = BoronPduSender.DEFAULT_MULTICAST_PORT;
......@@ -68,6 +76,7 @@ public class BoronPduReceiver
message.append(")");
System.out.println(message.toString());
//If PDU is an Entity State PDU, print location of entity
if (currentPduType == ENTITY_STATE)
{
EntityStatePdu espdu = new EntityStatePdu();
......
......@@ -8,12 +8,12 @@ import edu.nps.moves.dis7.*;
import edu.nps.moves.dis7.enumerations.*;
/**
* This is an example that sends many/most types of PDUs. Useful for testing standards
* compliance or getting a full set of PDUs. It also writes the generated PDUs to an XML file.
* Adapted from OpenDIS library example package edu.nps.moves.examples
* Takes a PDU and sends it to a multicast address. This program works in collaboration with separate
* PDU constructor classes. Current main method creates and sends Entity State PDUs to demonstrate
* functionality.
*
* @author DMcG
* @version $Id:$
* @author jonathanboron
* @version 1.3
*/
public class BoronPduSender
{
......@@ -133,7 +133,7 @@ public class BoronPduSender
if (args.length == 2)
{
BoronPduSender sender = new BoronPduSender(Integer.parseInt(args[0]), args[1]);
for (int i = 0; i < generatedPdusList.size(); i++)
while (!generatedPdusList.isEmpty())
{
Pdu aPdu = generatedPdusList.get(0);
sender.run(aPdu);
......@@ -145,7 +145,7 @@ public class BoronPduSender
System.out.println("Usage: AllPduSender <port> <multicast group>");
System.out.println("Default: AllPduSender " + DEFAULT_MULTICAST_PORT + " " + DEFAULT_MULTICAST_ADDRESS);
BoronPduSender sender = new BoronPduSender(DEFAULT_MULTICAST_PORT, DEFAULT_MULTICAST_ADDRESS);
for (int i = 0; i < generatedPdusList.size(); i++)
while (!generatedPdusList.isEmpty())
{
Pdu aPdu = generatedPdusList.get(0);
sender.run(aPdu);
......
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