diff --git a/assignments/build.xml b/assignments/build.xml index 3f76d8515b25678fcc05c1472fbb9b39d4eb24c6..9db296a1eb71f788d73a16184405c8dcca8d9dd5 100644 --- a/assignments/build.xml +++ b/assignments/build.xml @@ -71,7 +71,12 @@ --> - <target name="view.gitlab.assignments" description="view gitlab MV3500 examples in web browser (via Netbeans only)"> + <target name="view.javadoc" description="view MV3500 assignments javadoc in web browser (via Netbeans only)"> + <echo message="dist/javadoc/index.html"/> + <nbbrowse url="dist/javadoc/index.html"/> + </target> + + <target name="view.gitlab.assignments" description="view gitlab MV3500 assignments in web browser (via Netbeans only)"> <echo message="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/tree/master/assignments"/> <nbbrowse url="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/tree/master/assignments"/> </target> diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/AngelClient.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/AngelClient.java index 6a0e37d58b2ead379cb95dab13516e8aa03797bc..85c0839b899590227d40feec1004ccf884337ad1 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/AngelClient.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/AngelClient.java @@ -16,7 +16,7 @@ import java.net.*; public class AngelClient { /** - * @param args the command line arguments + * @param args command-line arguments */ public static void main(String[] args) { diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/AngelServer.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/AngelServer.java index 3bc98c4ca7a71f185be6474284336c9ec1d56923..db6dfd422a9ab5d68802016ac106aeabb0a054c7 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/AngelServer.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/AngelServer.java @@ -16,7 +16,7 @@ import java.net.*; public class AngelServer { /** - * @param args the command line arguments + * @param args command-line arguments */ public static void main(String[] args) { // TODO code application logic here diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/BlankenbekerMyTcpServer.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/BlankenbekerMyTcpServer.java index 0f9f3fe7e054a10aa69ebb187926d0841fc06084..1f06beab781870e128818644a93ff8a47a70be5c 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/BlankenbekerMyTcpServer.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/BlankenbekerMyTcpServer.java @@ -18,7 +18,7 @@ import java.net.*; * If you're sophisticated you can contact the instructor's computer * while running this program. * - * telnet <ipOfServersLaptop> 2317 + * telnet [ipAddressOfServerLaptop] 2317 * * And have him display the socket pairs he got. * @author mcgredo diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/HanleyTcpServer.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/HanleyTcpServer.java index f54711e6e5d83ccc3d702d44f434f9b61774e847..ec432a4f1fcf2df7d566b9c82faaefd82f431104 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/HanleyTcpServer.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/HanleyTcpServer.java @@ -27,7 +27,7 @@ public class HanleyTcpServer { * If you're sophisticated you can contact the instructor's computer * while running this program. * - * telnet <ipOfServersLaptop> 2317 + * telnet [ipAddressOfServerLaptop] 2317 * * And have him display the socket pairs he got. * @author mcgredo diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/LandasClient1.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/LandasClient1.java index 75c31bbad7ec299cd4d9b4606ee42d89637635ba..0c08bf55c83f05db606ade77e6d0408d527056a0 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/LandasClient1.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/LandasClient1.java @@ -15,7 +15,7 @@ import java.net.*; public class LandasClient1 { /** - * @param args the command line arguments + * @param args command-line arguments */ public static void main(String[] args) { diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/LandasClient2.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/LandasClient2.java index fe7d94857ce10622ed66b4a3b6740d928fa06391..3ab74dee1dfe47b7a01e1de7f2f8036cbbfb4cf5 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/LandasClient2.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/LandasClient2.java @@ -20,7 +20,7 @@ public class LandasClient2 { public static DataOutputStream out; /** - * @param args the command line arguments + * @param args command-line arguments */ public static void main(String[] args) { // TODO code application logic here diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/LandasServer1.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/LandasServer1.java index 67e2a543d754237aa075dc4df3b787f5ee4b5415..5e0aae6ec3498017ffdc5fe53d0db6ba008783bf 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/LandasServer1.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/LandasServer1.java @@ -15,7 +15,7 @@ import java.net.*; public class LandasServer1 { /** - * @param args the command line arguments + * @param args command-line arguments */ public static void main(String[] args) { diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/LandasServer2.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/LandasServer2.java index c42b8a82a67d38e1d58a2e1361b8b88d78d27c34..0314fced00c960226aafa617a6d841ad20555d1e 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/LandasServer2.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/LandasServer2.java @@ -22,7 +22,7 @@ public class LandasServer2 { public static DataOutputStream out; /** - * @param args the command line arguments + * @param args command-line arguments */ public static void main(String[] args) { // TODO code application logic here diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/MaroonTcpServer.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/MaroonTcpServer.java index 9b0d5731e8473aef4e9e73efcb9fc1d5a10598f8..ca3c810813bb7193f4ce8c86700c6f306c0efc01 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/MaroonTcpServer.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/MaroonTcpServer.java @@ -24,7 +24,7 @@ import java.util.Arrays; * If you're sophisticated you can contact the instructor's computer * while running this program. * - * telnet <ipOfServersLaptop> 2317 + * telnet [ipAddressOfServerLaptop] 2317 * * And have him display the socket pairs he got. * @author mcgredo diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/SasalaClient.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/SasalaClient.java index 55c6653d8f65f30783ffc0b1d8844176e52fb6f0..b30005559cfb2a42f8ba625b29e5d8260d728c08 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/SasalaClient.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/SasalaClient.java @@ -11,7 +11,7 @@ import java.net.*; public class SasalaClient { /** - * @param args the command line arguments + * @param args command-line arguments */ public static void main(String[] args) { // TODO code application logic here diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/SasalaServer.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/SasalaServer.java index e048afe8f8c6cd90f9e70599ce72a20cd7fe89aa..c9d183ad190d411017e2c846332ff51ae7faac9a 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/SasalaServer.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/SasalaServer.java @@ -11,7 +11,7 @@ import java.net.*; public class SasalaServer { /** - * @param args the command line arguments + * @param args command-line arguments */ public static void main(String[] args) { diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/SnellPositionClient.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/SnellPositionClient.java index 5c81461abc7a99611c16e4c72b023453d7943512..519cf844ca49ba93da82f8b79d279df98dd957ca 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/SnellPositionClient.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/SnellPositionClient.java @@ -15,7 +15,7 @@ import java.net.UnknownHostException; */ public class SnellPositionClient { /** - * @param args the command line arguments + * @param args command-line arguments * @throws java.io.IOException */ public static void main(String[] args) throws IOException { diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/SnellPositionServer.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/SnellPositionServer.java index a4ec0eee09d1d80a1a1c812156f1fdb08c95955d..ed6c9b389b538b58a21d68dfdbaed585106b7501 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/SnellPositionServer.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/SnellPositionServer.java @@ -11,7 +11,7 @@ import java.io.PrintWriter; public class SnellPositionServer { /** - * @param args the command line arguments + * @param args command-line arguments * @throws java.io.IOException */ public static void main(String[] args) throws IOException { diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/TackettTcpServer.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/TackettTcpServer.java index 49d2f0c922bfdae964fb2a0e496a5ffbabc82da7..edb1f40ca73a9bd6503caaeb32514b6a7018f8a3 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/TackettTcpServer.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework1/TackettTcpServer.java @@ -20,7 +20,7 @@ import java.net.*; * If you're sophisticated you can contact the instructor's computer * while running this program. * - * telnet <ipOfServersLaptop> 2317 + * telnet [ipAddressOfServerLaptop] 2317 * * And have him display the socket pairs he got. * @author mcgredo diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/Angel_OpenDisEspduSender.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/Angel_OpenDisEspduSender.java index 9b9c8cf81098eee4a9907eba5828e70b0bbd84d6..6dec6bd38359a650e7f4ba646a09f6a8dd6b4361 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/Angel_OpenDisEspduSender.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/Angel_OpenDisEspduSender.java @@ -34,7 +34,7 @@ public class Angel_OpenDisEspduSender * calculator, for example http://www.remotemonitoringsystems.ca/broadcast.php * If in multicast mode, a join() will be done on the multicast address. * port: port used for both source and destination. - * @param args + * @param args command-line arguments */ public static void main(String args[]) { diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/BlankenbekerOpenDisEspduSender.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/BlankenbekerOpenDisEspduSender.java index e77db0d71a5a7f943d4522bf91e2c58ac1c0d314..f6171dd562946fc04e294c3e52301c55e3218720 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/BlankenbekerOpenDisEspduSender.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/BlankenbekerOpenDisEspduSender.java @@ -25,7 +25,7 @@ public class BlankenbekerOpenDisEspduSender /** Default multicast group address we send on */ public static final String DEFAULT_MULTICAST_GROUP="239.1.2.3"; - private static final ArrayList <Float[]> track = new ArrayList<>(); + public static final ArrayList <Float[]> track = new ArrayList<>(); /** Default port we send on */ public static final int DIS_DESTINATION_PORT = 3000; @@ -37,7 +37,7 @@ public class BlankenbekerOpenDisEspduSender * calculator, for example http://www.remotemonitoringsystems.ca/broadcast.php * If in multicast mode, a join() will be done on the multicast address. * port: port used for both source and destination. - * @param args + * @param args command-line arguments */ public static void main(String args[]) { diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/ConardSnellOpenDisEspduSender.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/ConardSnellOpenDisEspduSender.java index c44229c8c68e80db6c226af99b7297071acff429..b0a5973d4b9ff30f275cb388d68115cc8d819182 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/ConardSnellOpenDisEspduSender.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/ConardSnellOpenDisEspduSender.java @@ -34,7 +34,7 @@ public class ConardSnellOpenDisEspduSender * calculator, for example http://www.remotemonitoringsystems.ca/broadcast.php * If in multicast mode, a join() will be done on the multicast address. * port: port used for both source and destination. - * @param args + * @param args command-line arguments */ public static void main(String args[]) { diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/Hanley_OpenDisEspduSender.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/Hanley_OpenDisEspduSender.java index f3ef26c2f42c81b16a9a2d6ce0ca1e72610354ef..455674db916051dd908b0f1e5829eaea1980b007 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/Hanley_OpenDisEspduSender.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/Hanley_OpenDisEspduSender.java @@ -34,7 +34,7 @@ public class Hanley_OpenDisEspduSender * calculator, for example http://www.remotemonitoringsystems.ca/broadcast.php * If in multicast mode, a join() will be done on the multicast address. * port: port used for both source and destination. - * @param args + * @param args command-line arguments */ public static void main(String args[]) { diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/Landas_OpenDisEspduSender.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/Landas_OpenDisEspduSender.java index 89600a94d61fb57066d05181226bd2b4ae7c72bb..a2c39578ee49f7a527712772fc1ed2ed2875a390 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/Landas_OpenDisEspduSender.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/Landas_OpenDisEspduSender.java @@ -27,7 +27,7 @@ public class Landas_OpenDisEspduSender /** Default port we send on */ public static final int DIS_DESTINATION_PORT = 3000; - private static final ArrayList <Float[]> track_coordinates = new ArrayList<>(); + public static final ArrayList <Float[]> track_coordinates = new ArrayList<>(); /** Possible system properties, passed in via -Dattr=val * networkMode: unicast, broadcast, multicast @@ -36,7 +36,7 @@ public class Landas_OpenDisEspduSender * calculator, for example http://www.remotemonitoringsystems.ca/broadcast.php * If in multicast mode, a join() will be done on the multicast address. * port: port used for both source and destination. - * @param args + * @param args command-line arguments */ public static void main(String args[]) { diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/OpenDisEspduSender.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/OpenDisEspduSender.java index 10ff416803f75057820261bcd4de110c991bdffb..8db3d7cd7969fc9ad0bb585f9f9415dac785fef2 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/OpenDisEspduSender.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/OpenDisEspduSender.java @@ -24,7 +24,7 @@ public class OpenDisEspduSender /** Default multicast group address we send on */ public static final String DEFAULT_MULTICAST_GROUP="239.1.2.3"; - private static final ArrayList <Float[]> track = new ArrayList<>(); + public static final ArrayList <Float[]> track = new ArrayList<>(); /** Default port we send on */ public static final int DIS_DESTINATION_PORT = 3000; @@ -36,7 +36,7 @@ public class OpenDisEspduSender * calculator, for example http://www.remotemonitoringsystems.ca/broadcast.php * If in multicast mode, a join() will be done on the multicast address. * port: port used for both source and destination. - * @param args + * @param args command-line arguments */ public static void main(String args[]) { diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/Sasala_OpenDisEspduSender1.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/Sasala_OpenDisEspduSender1.java index 6b3991583c0ae6ac4f0c5dfbea6efa8e93827874..3f8d30eb5cd4eda9b98eb16a7b6f76e5bfab20b5 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/Sasala_OpenDisEspduSender1.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/Sasala_OpenDisEspduSender1.java @@ -33,7 +33,7 @@ public class Sasala_OpenDisEspduSender1 * calculator, for example http://www.remotemonitoringsystems.ca/broadcast.php * If in multicast mode, a join() will be done on the multicast address. * port: port used for both source and destination. - * @param args + * @param args command-line arguments */ public static void main(String args[]) { diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/Tackett_Assignment3_OpenDisEspduSender.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/Tackett_Assignment3_OpenDisEspduSender.java index d8c901dd2aa589fdd1f7fae86c2fdab7b7e07e82..0adc83480016be4e7358692ba746befb99b606d9 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/Tackett_Assignment3_OpenDisEspduSender.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/Tackett_Assignment3_OpenDisEspduSender.java @@ -27,7 +27,7 @@ public class Tackett_Assignment3_OpenDisEspduSender /** Default port we send on */ public static final int DIS_DESTINATION_PORT = 3000; - private static final ArrayList <Float[]> track_coordinates = new ArrayList<>(); + public static final ArrayList <Float[]> track_coordinates = new ArrayList<>(); /** Possible system properties, passed in via -Dattr=val * networkMode: unicast, broadcast, multicast @@ -36,7 +36,7 @@ public class Tackett_Assignment3_OpenDisEspduSender * calculator, for example http://www.remotemonitoringsystems.ca/broadcast.php * If in multicast mode, a join() will be done on the multicast address. * port: port used for both source and destination. - * @param args + * @param args command-line arguments */ public static void main(String args[]) { diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/YamashitaDeMouraOpenDisEspduSender.java b/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/YamashitaDeMouraOpenDisEspduSender.java index a74fc6c641661735ee78de34ec421bbbc406aaeb..9be3ee502f72a5a0bea32e33ec28620a71f08eda 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/YamashitaDeMouraOpenDisEspduSender.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/homework3/YamashitaDeMouraOpenDisEspduSender.java @@ -37,7 +37,7 @@ public class YamashitaDeMouraOpenDisEspduSender * calculator, for example http://www.remotemonitoringsystems.ca/broadcast.php * If in multicast mode, a join() will be done on the multicast address. * port: port used for both source and destination. - * @param args + * @param args command-line arguments */ public static void main(String args[]) { diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/projects/AngelopoulosBlankenbeker/AngelBlankEspduSenderA.java b/assignments/src/MV3500Cohort2018JanuaryMarch/projects/AngelopoulosBlankenbeker/AngelBlankEspduSenderA.java index 00b50c296b42e7f12039af946240ec05a1c2f807..517d24d313605f28ef491b32b1a3e32495c0b532 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/projects/AngelopoulosBlankenbeker/AngelBlankEspduSenderA.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/projects/AngelopoulosBlankenbeker/AngelBlankEspduSenderA.java @@ -34,7 +34,7 @@ public class AngelBlankEspduSenderA * caclulator, for example http://www.remotemonitoringsystems.ca/broadcast.php * If in mcast mode, a join() will be done on the mcast address. * port: port used for both source and destination. - * @param args + * @param args command-line arguments */ public static void main(String args[]) { diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/projects/AngelopoulosBlankenbeker/AngelBlankEspduTCPReceiverASenderB.java b/assignments/src/MV3500Cohort2018JanuaryMarch/projects/AngelopoulosBlankenbeker/AngelBlankEspduTCPReceiverASenderB.java index 2100083d4f551c03e6c17d3c6f0e662497393b6b..1314bb186b33ee406a80695c1e27e4da52c3dc9e 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/projects/AngelopoulosBlankenbeker/AngelBlankEspduTCPReceiverASenderB.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/projects/AngelopoulosBlankenbeker/AngelBlankEspduTCPReceiverASenderB.java @@ -34,7 +34,7 @@ public class AngelBlankEspduTCPReceiverASenderB * caclulator, for example http://www.remotemonitoringsystems.ca/broadcast.php * If in mcast mode, a join() will be done on the mcast address. * port: port used for both source and destination. - * @param args + * @param args command-line arguments */ public static void main(String args[]) { diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/projects/Hanley/HanleyOpenDisEspduSenderFP.java b/assignments/src/MV3500Cohort2018JanuaryMarch/projects/Hanley/HanleyOpenDisEspduSenderFP.java index 0c9dc6fa75d881103de606bc479bff6f25f74efc..9b31f8a3355063f3afc32f9ba456ca07d58f14f7 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/projects/Hanley/HanleyOpenDisEspduSenderFP.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/projects/Hanley/HanleyOpenDisEspduSenderFP.java @@ -43,7 +43,7 @@ public class HanleyOpenDisEspduSenderFP * calculator, for example http://www.remotemonitoringsystems.ca/broadcast.php * If in multicast mode, a join() will be done on the multicast address. * port: port used for both source and destination. - * @param args + * @param args command-line arguments * @throws FileNotFoundException if csv file not found */ public static void main(String args[]) throws FileNotFoundException diff --git a/assignments/src/MV3500Cohort2018JanuaryMarch/projects/SasalaMaroon/CSVreaderOpenDisEspduSenderFP.java b/assignments/src/MV3500Cohort2018JanuaryMarch/projects/SasalaMaroon/CSVreaderOpenDisEspduSenderFP.java index f8eaefc4de2d6c95bafab5152616e422b5dab835..d38a0c90e7e34edb74f098eef91cc6442489adae 100644 --- a/assignments/src/MV3500Cohort2018JanuaryMarch/projects/SasalaMaroon/CSVreaderOpenDisEspduSenderFP.java +++ b/assignments/src/MV3500Cohort2018JanuaryMarch/projects/SasalaMaroon/CSVreaderOpenDisEspduSenderFP.java @@ -52,7 +52,7 @@ public class CSVreaderOpenDisEspduSenderFP * calculator, for example http://www.remotemonitoringsystems.ca/broadcast.php * If in multicast mode, a join() will be done on the multicast address. * port: port used for both source and destination. - * @param args + * @param args command-line arguments */ public static void main(String args[]) throws FileNotFoundException { diff --git a/assignments/src/MV3500Cohort2018JulySeptember/homework1/LoeffelmanAssignment1.java b/assignments/src/MV3500Cohort2018JulySeptember/homework1/LoeffelmanAssignment1.java index 3d0a12b434d23812a1c6a9350da54ace91e0162a..36e25caa671f1f6c2820dd754617224424d36417 100644 --- a/assignments/src/MV3500Cohort2018JulySeptember/homework1/LoeffelmanAssignment1.java +++ b/assignments/src/MV3500Cohort2018JulySeptember/homework1/LoeffelmanAssignment1.java @@ -17,7 +17,7 @@ import java.net.Socket; public class LoeffelmanAssignment1 { /** - * @param args the command line arguments + * @param args command-line arguments */ public static void main(String[] args) { try diff --git a/assignments/src/MV3500Cohort2018JulySeptember/homework1/LoeffelmanAssignment1Tcp2.java b/assignments/src/MV3500Cohort2018JulySeptember/homework1/LoeffelmanAssignment1Tcp2.java index 7f420b3c97d7fe385fe567c2b0cffd2c0d6e78d5..f8d0698f705bcc7635abfa651f6e9856e059de0f 100644 --- a/assignments/src/MV3500Cohort2018JulySeptember/homework1/LoeffelmanAssignment1Tcp2.java +++ b/assignments/src/MV3500Cohort2018JulySeptember/homework1/LoeffelmanAssignment1Tcp2.java @@ -18,7 +18,7 @@ import java.net.Socket; public class LoeffelmanAssignment1Tcp2 { /** - * @param args the command line arguments + * @param args command-line arguments */ public static void main(String[] args) { // TODO code application logic here diff --git a/assignments/src/MV3500Cohort2018JulySeptember/homework1/SeversonAssignment1.java b/assignments/src/MV3500Cohort2018JulySeptember/homework1/SeversonAssignment1.java index 472aa0ff45588c5be8b682af7391924c2e516507..90419dc2b2d16ecbf6ca8c1fdea468e7ba159b79 100644 --- a/assignments/src/MV3500Cohort2018JulySeptember/homework1/SeversonAssignment1.java +++ b/assignments/src/MV3500Cohort2018JulySeptember/homework1/SeversonAssignment1.java @@ -19,7 +19,7 @@ import java.net.Socket; public class SeversonAssignment1 { /** - * @param args the command line arguments + * @param args command-line arguments */ public static void main(String[] args) { diff --git a/assignments/src/MV3500Cohort2018JulySeptember/homework2/CainTcpServer.java b/assignments/src/MV3500Cohort2018JulySeptember/homework2/CainTcpServer.java index 31b39704ed3447c7531839818d9ae2cb61d32533..b73b55794b8bd56b53f4b10b7a59bc71ee938981 100644 --- a/assignments/src/MV3500Cohort2018JulySeptember/homework2/CainTcpServer.java +++ b/assignments/src/MV3500Cohort2018JulySeptember/homework2/CainTcpServer.java @@ -6,7 +6,7 @@ import java.net.*; /** * * telnet localhost 2468 - * telnet <ipOfServersLaptop> 2468 + * telnet [ipAddressOfServerLaptop] 2468 * credit to author mcgredo */ public class CainTcpServer diff --git a/assignments/src/MV3500Cohort2018JulySeptember/homework2/Frisco/FriscoAssignment2Server.java b/assignments/src/MV3500Cohort2018JulySeptember/homework2/Frisco/FriscoAssignment2Server.java index 51c38d105f500168c1d6d60a88121805af241c18..b1a567edb70549fc8fe1641a555cd02a065b98ec 100644 --- a/assignments/src/MV3500Cohort2018JulySeptember/homework2/Frisco/FriscoAssignment2Server.java +++ b/assignments/src/MV3500Cohort2018JulySeptember/homework2/Frisco/FriscoAssignment2Server.java @@ -11,7 +11,7 @@ import java.net.*; * compare the socket pairs.telnet localhost 2317 * If you're sophisticated you can contact the instructor's computer while running this program. * - * telnet <ipOfServersLaptop> 2317 + * telnet [ipAddressOfServerLaptop] 2317 * * And have him display the socket pairs he got. * diff --git a/assignments/src/MV3500Cohort2018JulySeptember/homework2/Furr/FurrTcpServer.java b/assignments/src/MV3500Cohort2018JulySeptember/homework2/Furr/FurrTcpServer.java index 255ab03e5e2b8a6941a327131e858502fc55b3ae..bd46de4f22742b7ed62b7258e6bd4ac14a1bc807 100644 --- a/assignments/src/MV3500Cohort2018JulySeptember/homework2/Furr/FurrTcpServer.java +++ b/assignments/src/MV3500Cohort2018JulySeptember/homework2/Furr/FurrTcpServer.java @@ -10,7 +10,7 @@ import java.net.*; * * If you're sophisticated you can contact the instructor's computer while running this program. * - * telnet <ipOfServersLaptop> 2317 + * telnet [ipAddressOfServerLaptop] 2317 * * And have him display the socket pairs he got. * diff --git a/assignments/src/MV3500Cohort2018JulySeptember/homework2/Severson/SeversonAssignment2_Client.java b/assignments/src/MV3500Cohort2018JulySeptember/homework2/Severson/SeversonAssignment2_Client.java index 09272cd1fd4ddee0541857a66e20ffdac9298d77..4c7801d4fc21b43095e58f2e28ca960797e15318 100644 --- a/assignments/src/MV3500Cohort2018JulySeptember/homework2/Severson/SeversonAssignment2_Client.java +++ b/assignments/src/MV3500Cohort2018JulySeptember/homework2/Severson/SeversonAssignment2_Client.java @@ -25,7 +25,7 @@ public class SeversonAssignment2_Client { public final static String LOCALHOST = "0:0:0:0:0:0:0:1"; /** - * @param args the command line arguments + * @param args command-line arguments */ public static void main(String[] args) { diff --git a/assignments/src/MV3500Cohort2018JulySeptember/homework2/Severson/SeversonAssingment2_Server.java b/assignments/src/MV3500Cohort2018JulySeptember/homework2/Severson/SeversonAssingment2_Server.java index 9d2c934fe6e79a38276d5eb10043cd81243596ec..280e06b7310e41a04a00a080e8f17677d1a5b1a9 100644 --- a/assignments/src/MV3500Cohort2018JulySeptember/homework2/Severson/SeversonAssingment2_Server.java +++ b/assignments/src/MV3500Cohort2018JulySeptember/homework2/Severson/SeversonAssingment2_Server.java @@ -22,7 +22,7 @@ import java.net.Socket; public class SeversonAssingment2_Server { /** - * @param args the command line arguments + * @param args command-line arguments */ public static void main(String[] args) { diff --git a/assignments/src/MV3500Cohort2018JulySeptember/homework3/Jackson_UdpReceiver.java b/assignments/src/MV3500Cohort2018JulySeptember/homework3/Jackson_UdpReceiver.java index b7311cc8d51a7a62c450dccbb2e191c5f61ce7c8..0396c08fc64711a74d20c2ddb8909a4bb838eff0 100644 --- a/assignments/src/MV3500Cohort2018JulySeptember/homework3/Jackson_UdpReceiver.java +++ b/assignments/src/MV3500Cohort2018JulySeptember/homework3/Jackson_UdpReceiver.java @@ -16,7 +16,7 @@ public class Jackson_UdpReceiver public static final String DESINATION_HOST = "localhost"; /** - * @param args the command line arguments + * @param args command-line arguments */ public static void main(String[] args) { diff --git a/assignments/src/MV3500Cohort2018JulySeptember/homework3/Loeffelman_Severson_Homework3/LoeffelmanSeversonUDPImageHW3Receiver.java b/assignments/src/MV3500Cohort2018JulySeptember/homework3/Loeffelman_Severson_Homework3/LoeffelmanSeversonUDPImageHW3Receiver.java index c2b5b817432fbeb3d50513164f281b0aa4ec1eae..7da665ca6b3fb0e0c54ad3ccb8434eff6a041856 100644 --- a/assignments/src/MV3500Cohort2018JulySeptember/homework3/Loeffelman_Severson_Homework3/LoeffelmanSeversonUDPImageHW3Receiver.java +++ b/assignments/src/MV3500Cohort2018JulySeptember/homework3/Loeffelman_Severson_Homework3/LoeffelmanSeversonUDPImageHW3Receiver.java @@ -28,7 +28,7 @@ public class LoeffelmanSeversonUDPImageHW3Receiver { public static final String DESINATION_HOST = "localhost"; /** - * @param args the command line arguments + * @param args command-line arguments the command line arguments */ public static void main(String[] args) { diff --git a/assignments/src/MV3500Cohort2018JulySeptember/projects/FriscoFurr/FDCSendRecieve.java b/assignments/src/MV3500Cohort2018JulySeptember/projects/FriscoFurr/FDCSendRecieve.java index 1f74fb79099de8185cf6ce0bb8f4a75f0879e7b4..0d88800867d4feb23a218aaa146a0ca3c5fdf805 100644 --- a/assignments/src/MV3500Cohort2018JulySeptember/projects/FriscoFurr/FDCSendRecieve.java +++ b/assignments/src/MV3500Cohort2018JulySeptember/projects/FriscoFurr/FDCSendRecieve.java @@ -120,7 +120,7 @@ public class FDCSendRecieve { /** * Main function takes no specific arguments, but is the recieving portion of the code. Once it hears a specific type of PDU it creates another and sends it to the Run function * called sender created on line 130 (2nd statement in the main function) - * @param args + * @param args command-line arguments * @throws IOException * @throws InterruptedException */ diff --git a/assignments/src/MV3500Cohort2018JulySeptember/projects/FriscoFurr/OBSSendRecieve1.java b/assignments/src/MV3500Cohort2018JulySeptember/projects/FriscoFurr/OBSSendRecieve1.java index b4efcd209d89ad793db28dc9b375b9ab74cafa22..1320960335fc9c756b152a42ed935f3be2a886d8 100644 --- a/assignments/src/MV3500Cohort2018JulySeptember/projects/FriscoFurr/OBSSendRecieve1.java +++ b/assignments/src/MV3500Cohort2018JulySeptember/projects/FriscoFurr/OBSSendRecieve1.java @@ -124,7 +124,7 @@ public class OBSSendRecieve1 { /** * Main function takes no specific arguments, but is the recieving portion of the code. Once it hears a specific type of PDU it creates another and sends it to the Run function * called sender created on line 136 (2nd statement in the main function) - * @param args + * @param args command-line arguments * @throws IOException */ public static void main(String[] args) throws IOException { diff --git a/assignments/src/MV3500Cohort2018JulySeptember/projects/FriscoFurr/TGTSendRecieve.java b/assignments/src/MV3500Cohort2018JulySeptember/projects/FriscoFurr/TGTSendRecieve.java index dbfde193ca0996d8c7d0c4961d1bfb612e6c3911..e8aadc7eced6b62fd3a42d4238393b943fb5a93d 100644 --- a/assignments/src/MV3500Cohort2018JulySeptember/projects/FriscoFurr/TGTSendRecieve.java +++ b/assignments/src/MV3500Cohort2018JulySeptember/projects/FriscoFurr/TGTSendRecieve.java @@ -122,7 +122,7 @@ public class TGTSendRecieve { /** * Main function takes no specific arguments, but is the recieving portion of the code. Once it hears a specific type of PDU it creates another and sends it to the Run function * called sender created on line 135 (2nd statement in the main function) - * @param args + * @param args command-line arguments * @throws IOException */ public static void main(String[] args) throws IOException { diff --git a/assignments/src/MV3500Cohort2019JulySeptember/homework4/Brennenstuhl/BrennenstuhlEspduSender.java b/assignments/src/MV3500Cohort2019JulySeptember/homework4/Brennenstuhl/BrennenstuhlEspduSender.java index 5f858f444529d16e5bc751d5556be77c286fe80b..b8feae689d51a936dc38e87edfba315fd694aabb 100644 --- a/assignments/src/MV3500Cohort2019JulySeptember/homework4/Brennenstuhl/BrennenstuhlEspduSender.java +++ b/assignments/src/MV3500Cohort2019JulySeptember/homework4/Brennenstuhl/BrennenstuhlEspduSender.java @@ -45,7 +45,7 @@ public class BrennenstuhlEspduSender * a join() will be done on the multicast address. port: port used for both * source and destination. * - * @param args + * @param args command-line arguments */ public static void main(String args[]) { diff --git a/assignments/src/MV3500Cohort2019JulySeptember/homework4/Schutt/SchuttESPDUSender.java b/assignments/src/MV3500Cohort2019JulySeptember/homework4/Schutt/SchuttESPDUSender.java index 75912bbef4cbb96dd1b50431b08858a73b824bc4..d332eed0443baab5630141d33f20297eb0f2323d 100644 --- a/assignments/src/MV3500Cohort2019JulySeptember/homework4/Schutt/SchuttESPDUSender.java +++ b/assignments/src/MV3500Cohort2019JulySeptember/homework4/Schutt/SchuttESPDUSender.java @@ -51,7 +51,7 @@ public class SchuttESPDUSender { * a join() will be done on the multicast address. port: port used for both * source and destination. * - * @param args + * @param args command-line arguments */ public static void main(String args[]) { System.out.println("SchuttESPDUSender started..."); diff --git a/assignments/src/MV3500Cohort2019JulySeptember/homework4/Yurkovich/Yurk_EspduSender.java b/assignments/src/MV3500Cohort2019JulySeptember/homework4/Yurkovich/Yurk_EspduSender.java index 3cd8c5befe8559adbd79f8f16912760eed08ff26..11af1378435251a29987cd0c913870f4296cb8d7 100644 --- a/assignments/src/MV3500Cohort2019JulySeptember/homework4/Yurkovich/Yurk_EspduSender.java +++ b/assignments/src/MV3500Cohort2019JulySeptember/homework4/Yurkovich/Yurk_EspduSender.java @@ -41,7 +41,7 @@ public class Yurk_EspduSender * a join() will be done on the multicast address. port: port used for both * source and destination. * - * @param args + * @param args command-line arguments */ public static void main(String args[]) { diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework1/CannonTcpExample1Telnet.java b/assignments/src/MV3500Cohort2020JulySeptember/homework1/CannonTcpExample1Telnet.java index 86eb9df7c361ecf0db21e602beb162be2afb89ac..28027e300fb799b886b722822c74d601e3aafcb6 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework1/CannonTcpExample1Telnet.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework1/CannonTcpExample1Telnet.java @@ -14,7 +14,7 @@ import java.net.Socket; public class CannonTcpExample1Telnet { /** - * @param args the command line arguments + * @param args command-line arguments */ public static void main(String[] args) { try { diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework1/GoerickeTcpExample1Telnet.java b/assignments/src/MV3500Cohort2020JulySeptember/homework1/GoerickeTcpExample1Telnet.java index 606f5dc8e8922dad6f5f319bf7c320c24104494b..009f541410e1619b42caeada953a47a54de95cc8 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework1/GoerickeTcpExample1Telnet.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework1/GoerickeTcpExample1Telnet.java @@ -14,7 +14,7 @@ import java.net.Socket; public class GoerickeTcpExample1Telnet { /** - * @param args the command line arguments + * @param args command-line arguments */ public static void main(String[] args) throws IOException { System.out.println("Homework 1 MV3500 - Summer 2020 (Author: Stefan Goericke)"); diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework1/WeissenbergerTcpExample1Telnet.java b/assignments/src/MV3500Cohort2020JulySeptember/homework1/WeissenbergerTcpExample1Telnet.java index fe533df492208a80e94131a8e969510f172d5f51..319d385bfb9714c46cae16ec9e88e3bb823dfbaf 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework1/WeissenbergerTcpExample1Telnet.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework1/WeissenbergerTcpExample1Telnet.java @@ -9,8 +9,8 @@ import java.net.Socket; /** * Simple TCP Telnet Server, MV3500 Homework 1 - * copied parts from: TcpExample1Telnet.java by @author mcgredo & @author brutzman - * @date 07/16/2020 + * copied parts from: TcpExample1Telnet.java by @author mcgredo and @author brutzman + * @version 07/16/2020 * @author Loki */ public class WeissenbergerTcpExample1Telnet { diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework2/Cannon/CannonServer.java b/assignments/src/MV3500Cohort2020JulySeptember/homework2/Cannon/CannonServer.java index 74569a950f65d5f55fd5696af78ad460431bf18e..bd077a6c63bb9017088a39c24bba134f53471d06 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework2/Cannon/CannonServer.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework2/Cannon/CannonServer.java @@ -33,7 +33,7 @@ import java.net.Socket; public class CannonServer { /** - * @param args the command line arguments + * @param args command-line arguments */ public static void main(String[] args) { try { diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework2/Goericke/GoerickeServer.java b/assignments/src/MV3500Cohort2020JulySeptember/homework2/Goericke/GoerickeServer.java index b85a12b0e2d5d8a17eeea248b8b23c5c37e9c533..814b78bd60a87c7a21dec9f09c1d4eb97b2a5f5e 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework2/Goericke/GoerickeServer.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework2/Goericke/GoerickeServer.java @@ -28,7 +28,7 @@ public class GoerickeServer { /** - * @param args the command line arguments + * @param args command-line arguments */ public static void main(String[] args) { System.out.print(getLogo()); diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework2/Weissenberger/LokiChatClient.java b/assignments/src/MV3500Cohort2020JulySeptember/homework2/Weissenberger/LokiChatClient.java index 4c133b53fb47cbaf0686254824b86f5534f2192e..cac3cbd1c6599ec01c13fd65b1861de291bee34b 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework2/Weissenberger/LokiChatClient.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework2/Weissenberger/LokiChatClient.java @@ -98,7 +98,7 @@ public class LokiChatClient implements Runnable { /** * main method with fix IP and Port - * @param args + * @param args command-line arguments */ public static void main(String args[]) { LokiChatClient client = null; diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework2/Weissenberger/LokiChatServer.java b/assignments/src/MV3500Cohort2020JulySeptember/homework2/Weissenberger/LokiChatServer.java index 393d40bd9285d5cea5d6873d43e3d339bbf50ec5..42d46001556a975c88621e983e4951d0158fd5ef 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework2/Weissenberger/LokiChatServer.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework2/Weissenberger/LokiChatServer.java @@ -139,7 +139,7 @@ public class LokiChatServer implements Runnable { /** * the main for this class. Just starts a new server listening at port 2317 - * @param args + * @param args command-line arguments */ public static void main(String args[]) { LokiChatServer server = null; diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework3/Britt/UdpReceiver.java b/assignments/src/MV3500Cohort2020JulySeptember/homework3/Britt/UdpReceiver.java index cd1dfea7540df9ea87f7f3c9cf227af586f59ea1..869bc444d15ade6a546dba5e999f01eb9782771c 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework3/Britt/UdpReceiver.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework3/Britt/UdpReceiver.java @@ -10,8 +10,8 @@ import java.net.*; * * Start this before launching UdpSender. * - * @see https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html - * @see https://en.wikipedia.org/wiki/User_Datagram_Protocol + * @see <a href="https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html">https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html</a> + * @see <a href="https://en.wikipedia.org/wiki/User_Datagram_Protocol">https://en.wikipedia.org/wiki/User_Datagram_Protocol</a> * @author mcgredo * @author brutzman */ @@ -22,7 +22,7 @@ public class UdpReceiver public static final String DESINATION_HOST = "localhost"; /** - * @param args the command line arguments + * @param args command-line arguments * @throws java.io.IOException */ public static void main(String[] args) throws IOException diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework3/Britt/UdpSender.java b/assignments/src/MV3500Cohort2020JulySeptember/homework3/Britt/UdpSender.java index 0e4dc8fee99195aeeee1a537be44a7b27c18e99a..63480cde717525156fc2569671f73672ded45e26 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework3/Britt/UdpSender.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework3/Britt/UdpSender.java @@ -11,14 +11,14 @@ import java.net.*; * * Start this before launching UdpReceiver. * - * @see https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html - * @see https://en.wikipedia.org/wiki/User_Datagram_Protocol + * @see <a href="https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html">https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html</a> + * @see <a href="https://en.wikipedia.org/wiki/User_Datagram_Protocol">https://en.wikipedia.org/wiki/User_Datagram_Protocol</a> + * @see <a href="https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html">System properties</a> * @author mcgredo * @author brutzman */ public class UdpSender { - // System properties: https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html public static final String MY_NAME = System.getProperty("user.name"); // guru incantation 8) // public static final int SENDING_PORT = 1414; // not needed, can let system choose an open local port public static final int RECEIVING_PORT = 1415; diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework3/Cannon/CannonUdpReceiver.java b/assignments/src/MV3500Cohort2020JulySeptember/homework3/Cannon/CannonUdpReceiver.java index dfbb3430f83c30674323d55bd78a063562248eb2..10c88b479b97d69048ab89e7efbd5bbec2327573 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework3/Cannon/CannonUdpReceiver.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework3/Cannon/CannonUdpReceiver.java @@ -10,8 +10,8 @@ import java.net.*; * * Start this before launching UdpSender. * - * @see https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html - * @see https://en.wikipedia.org/wiki/User_Datagram_Protocol + * @see <a href="https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html">https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html</a> + * @see <a href="https://en.wikipedia.org/wiki/User_Datagram_Protocol">https://en.wikipedia.org/wiki/User_Datagram_Protocol</a> * @author mcgredo * @author brutzman */ @@ -22,7 +22,7 @@ public class CannonUdpReceiver public static final String DESINATION_HOST = "localhost"; /** - * @param args the command line arguments + * @param args command-line arguments * @throws java.io.IOException */ public static void main(String[] args) throws IOException diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework3/Cannon/CannonUdpSender.java b/assignments/src/MV3500Cohort2020JulySeptember/homework3/Cannon/CannonUdpSender.java index 471f5e0c49b35e0b6ca23906e218d26faf2b6ce9..812430f58d84137ba0ba3e489e04f6c0809806bf 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework3/Cannon/CannonUdpSender.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework3/Cannon/CannonUdpSender.java @@ -11,14 +11,14 @@ import java.net.*; * * Start this before launching UdpReceiver. * - * @see https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html - * @see https://en.wikipedia.org/wiki/User_Datagram_Protocol + * @see <a href="https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html">https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html</a> + * @see <a href="https://en.wikipedia.org/wiki/User_Datagram_Protocol">https://en.wikipedia.org/wiki/User_Datagram_Protocol</a> + * @see <a href="https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html">System properties</a> * @author mcgredo * @author brutzman */ public class CannonUdpSender { - // System properties: https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html public static final String MY_NAME = System.getProperty("user.name"); // guru incantation 8) // public static final int SENDING_PORT = 1414; // not needed, can let system choose an open local port public static final int RECEIVING_PORT = 1415; diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework3/Garibay/UDPReceiverGaribay.java b/assignments/src/MV3500Cohort2020JulySeptember/homework3/Garibay/UDPReceiverGaribay.java index 29a74cea5ae6d55fbde366c3b31d7ab288e1bff6..98c79c0360cabe7614d5c22c371c5a7d0958df58 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework3/Garibay/UDPReceiverGaribay.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework3/Garibay/UDPReceiverGaribay.java @@ -18,7 +18,7 @@ public class UDPReceiverGaribay public static final String DESINATION_HOST = "localhost"; /** - * @param args the command line arguments + * @param args command-line arguments * @throws java.io.IOException */ public static void main(String[] args) throws IOException diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework3/Goericke/TCPNumberReceiverUDPResultSender.java b/assignments/src/MV3500Cohort2020JulySeptember/homework3/Goericke/TCPNumberReceiverUDPResultSender.java index f9a58490506bf9d40d70cc31b3ce1bc758f87e24..ce432d7ee3fef12f0d81f7ef17eb7d6b776d07dd 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework3/Goericke/TCPNumberReceiverUDPResultSender.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework3/Goericke/TCPNumberReceiverUDPResultSender.java @@ -15,16 +15,17 @@ import java.net.Socket; /** * This class will be connected by an TCP sender over VPN (argon), calculating * a result of an equation and send the result back via UDP over VPN. - * @date 08/17/2020 - * @group Goericke/Weissenberger + * @version 08/17/2020 + * @author Goericke + * @author Weissenberger */ public class TCPNumberReceiverUDPResultSender { // Change this to the port where the TCP server is listening - private static final int TCP_ARGON_SERVER_PORT = 2317; + public static final int TCP_ARGON_SERVER_PORT = 2317; /** - * @param args the command line arguments + * @param args command-line arguments */ public static void main(String[] args) { try { diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework3/Mahan/MahanUdpReceiver.java b/assignments/src/MV3500Cohort2020JulySeptember/homework3/Mahan/MahanUdpReceiver.java index 7d7ca1757bf7b15d90f93c3d16e2f1fd5570ae38..af090a23bd74a8a2b1e1a08c17ae134af1b6606a 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework3/Mahan/MahanUdpReceiver.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework3/Mahan/MahanUdpReceiver.java @@ -14,7 +14,7 @@ public class MahanUdpReceiver public static final String DESINATION_HOST = "10.1.105.12"; /** - * @param args the command line arguments + * @param args command-line arguments * @throws java.io.IOException */ public static void main(String[] args) throws IOException diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework3/Weissenberger/TCPNumberSender.java b/assignments/src/MV3500Cohort2020JulySeptember/homework3/Weissenberger/TCPNumberSender.java index 8985ce40b6af5f0cbf8a5a2f3a183fa3edd20bef..5f00e22ff84f4a7810377948dba618ae9fbc746e 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework3/Weissenberger/TCPNumberSender.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework3/Weissenberger/TCPNumberSender.java @@ -9,25 +9,26 @@ import java.net.Socket; /** * This class will connect to an TCP receiver over VPN (argon) and send * two numbers - * @date 08/17/2020 + * @version 08/17/2020 * @author Loki - * @group Weissenberger/Goericke + * @author Goericke + * @author Weissenberger */ public class TCPNumberSender { // Change this to the IP address of the TCP server 10.1.105.9 (127.0.0.1 just for testing) - private static final String TCP_ARGON_SERVER_IP = "127.0.0.1"; + public static final String TCP_ARGON_SERVER_IP = "127.0.0.1"; // Change this to the port where the TCP server is listening - private static final int TCP_ARGON_SERVER_PORT = 2317; + public static final int TCP_ARGON_SERVER_PORT = 2317; // Where the result should be posted (port) - private static final int UDP_ARGON_RECEIVING_PORT = 1415; + public static final int UDP_ARGON_RECEIVING_PORT = 1415; - private static final int NUMBER1 = 16; - private static final int NUMBER2 = 2; - private static final String CALCULATION_METHOD = "-"; + public static final int NUMBER1 = 16; + public static final int NUMBER2 = 2; + public static final String CALCULATION_METHOD = "-"; // how many times should the number being sent - private static final int REPETITION = 1; + public static final int REPETITION = 1; private static int counter = 0; public static void main(String[] args) throws InterruptedException { diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework3/Weissenberger/UDPResultReceiver.java b/assignments/src/MV3500Cohort2020JulySeptember/homework3/Weissenberger/UDPResultReceiver.java index 8a348e72d82e6c0861d02896e489f24faa9239e1..8dc85b0427ad8f360a8577944cc97c55cea5bf27 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework3/Weissenberger/UDPResultReceiver.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework3/Weissenberger/UDPResultReceiver.java @@ -9,16 +9,17 @@ import java.net.DatagramSocket; /** * This class will be connected by an UDP sender over VPN (argon) - * @date 08/17/2020 + * @version 08/17/2020 * @author Loki - * @group Weissenberger/Goericke + * @author Goericke + * @author Weissenberger */ public class UDPResultReceiver { public static final int RECEIVING_PORT = 1415; /** - * @param args the command line arguments + * @param args command-line arguments * @throws java.io.IOException */ public static void main(String[] args) throws IOException diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework3/WeissenbergerGoericke/TCPNumberReceiverUDPResultSender.java b/assignments/src/MV3500Cohort2020JulySeptember/homework3/WeissenbergerGoericke/TCPNumberReceiverUDPResultSender.java index 14ac299c8a175857436a6989babc2a83a7575896..d07030183c9ff970b3224955c717c9370628e004 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework3/WeissenbergerGoericke/TCPNumberReceiverUDPResultSender.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework3/WeissenbergerGoericke/TCPNumberReceiverUDPResultSender.java @@ -15,16 +15,17 @@ import java.net.Socket; /** * This class will be connected by an TCP sender over VPN (argon), calculating * a result of an equation and send the result back via UDP over VPN. - * @date 08/17/2020 - * @group Goericke/Weissenberger + * @version 08/17/2020 + * @author Goericke + * @author Weissenberger */ public class TCPNumberReceiverUDPResultSender { // Change this to the port where the TCP server is listening - private static final int TCP_ARGON_SERVER_PORT = 2317; + public static final int TCP_ARGON_SERVER_PORT = 2317; /** - * @param args the command line arguments + * @param args command-line arguments */ public static void main(String[] args) { try { diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework3/WeissenbergerGoericke/TCPNumberSender.java b/assignments/src/MV3500Cohort2020JulySeptember/homework3/WeissenbergerGoericke/TCPNumberSender.java index b84a10f1b7da60f66fd938f4aafce52f684ba3d8..77833f77d0807b3a833674750c801b40b08a81b7 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework3/WeissenbergerGoericke/TCPNumberSender.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework3/WeissenbergerGoericke/TCPNumberSender.java @@ -9,25 +9,26 @@ import java.net.Socket; /** * This class will connect to an TCP receiver over VPN (argon) and send * two numbers - * @date 08/17/2020 + * @version 08/17/2020 * @author Loki - * @group Weissenberger/Goericke + * @author Goericke + * @author Weissenberger */ public class TCPNumberSender { // Change this to the IP address of the TCP server 10.1.105.10 (127.0.0.1 just for testing) - private static final String TCP_ARGON_SERVER_IP = "10.1.105.10"; + public static final String TCP_ARGON_SERVER_IP = "10.1.105.10"; // Change this to the port where the TCP server is listening - private static final int TCP_ARGON_SERVER_PORT = 2317; + public static final int TCP_ARGON_SERVER_PORT = 2317; // Where the result should be posted (port) - private static final int UDP_ARGON_RECEIVING_PORT = 1415; + public static final int UDP_ARGON_RECEIVING_PORT = 1415; - private static final int NUMBER1 = 16; - private static final int NUMBER2 = 2; - private static final String CALCULATION_METHOD = "-"; + public static final int NUMBER1 = 16; + public static final int NUMBER2 = 2; + public static final String CALCULATION_METHOD = "-"; // how many times should the number being sent - private static final int REPETITION = 1; + public static final int REPETITION = 1; private static int counter = 0; public static void main(String[] args) throws InterruptedException { diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework3/WeissenbergerGoericke/UDPResultReceiver.java b/assignments/src/MV3500Cohort2020JulySeptember/homework3/WeissenbergerGoericke/UDPResultReceiver.java index 1a181820810e24c66cfc6465fdb58824fad30e74..0aa8262ddc1985e09abc281b44d101bcca527718 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework3/WeissenbergerGoericke/UDPResultReceiver.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework3/WeissenbergerGoericke/UDPResultReceiver.java @@ -9,16 +9,17 @@ import java.net.DatagramSocket; /** * This class will be connected by an UDP sender over VPN (argon) - * @date 08/17/2020 + * @version 08/17/2020 * @author Loki - * @group Weissenberger/Goericke + * @author Goericke + * @author Weissenberger */ public class UDPResultReceiver { public static final int RECEIVING_PORT = 1415; /** - * @param args the command line arguments + * @param args command-line arguments * @throws java.io.IOException */ public static void main(String[] args) throws IOException diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework3/White/UdpReceiver.java b/assignments/src/MV3500Cohort2020JulySeptember/homework3/White/UdpReceiver.java index 3038d6c38f4dd72197269901ef2ba8e65fef339f..fdccdcf5084ab2c855991671d2b5436823130e09 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework3/White/UdpReceiver.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework3/White/UdpReceiver.java @@ -10,8 +10,8 @@ import java.net.*; * * Start this before launching UdpSender. * - * @see https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html - * @see https://en.wikipedia.org/wiki/User_Datagram_Protocol + * @see <a href="https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html">https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html</a> + * @see <a href="https://en.wikipedia.org/wiki/User_Datagram_Protocol">https://en.wikipedia.org/wiki/User_Datagram_Protocol</a> * @author mcgredo * @author brutzman */ @@ -22,7 +22,7 @@ public class UdpReceiver public static final String DESINATION_HOST = "localhost"; /** - * @param args the command line arguments + * @param args command-line arguments * @throws java.io.IOException */ public static void main(String[] args) throws IOException diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework3/White/UdpSender.java b/assignments/src/MV3500Cohort2020JulySeptember/homework3/White/UdpSender.java index d22d843330bf01b15fe4fd6edacbfea592ececc6..f6898e945a92d06f3844cd72f0fb67abedbd7cd4 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework3/White/UdpSender.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework3/White/UdpSender.java @@ -11,14 +11,14 @@ import java.net.*; * * Start this before launching UdpReceiver. * - * @see https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html - * @see https://en.wikipedia.org/wiki/User_Datagram_Protocol + * @see <a href="https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html">https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html</a> + * @see <a href="https://en.wikipedia.org/wiki/User_Datagram_Protocol">https://en.wikipedia.org/wiki/User_Datagram_Protocol</a> + * @see <a href="https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html">System properties</a> * @author mcgredo * @author brutzman */ public class UdpSender { - // System properties: https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html public static final String MY_NAME = "Alex"; // guru incantation 8) // public static final int SENDING_PORT = 1414; // not needed, can let system choose an open local port public static final int RECEIVING_PORT = 1415; diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework4/Britt/EspduSender.java b/assignments/src/MV3500Cohort2020JulySeptember/homework4/Britt/EspduSender.java index 7a4225844410726cd3fe39440e50c02bc31ccf98..714cc23e6358a46c4ce03b7c231d221d950d8f0a 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework4/Britt/EspduSender.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework4/Britt/EspduSender.java @@ -1,413 +1,413 @@ -package OpenDis7Examples; - -import java.io.*; -import java.net.*; -import java.util.*; - -import edu.nps.moves.dis7.pdus.*; -import edu.nps.moves.dis7.enumerations.Country; -import edu.nps.moves.dis7.enumerations.EntityKind; -import edu.nps.moves.dis7.enumerations.PlatformDomain; -import edu.nps.moves.dis7.utilities.*; -import edu.nps.moves.dis7.entities.usa.platform.land.M1A2; -import edu.nps.moves.dis7.entities.usa.platform.land.MTVRMK25Cargo; - -/** - * Creates and sends ESPDUs in IEEE binary format. Adapted from OpenDIS library - * example package edu.nps.moves.examples - * - * @author Don McGregor - * @author Don Brutzman - */ -public class EspduSender -{ - /** - * Putting any upper limit on # packets sent avoids possibility of non-terminating infinite loops that continue sending packets. - */ - public static final int NUMBER_OF_LOOPS = 2; // 5 - - /** - * Default multicast group address we send on. - */ - public static final String DEFAULT_MULTICAST_ADDRESS = "239.1.2.3"; - - /** - * Default multicast port used, matches Wireshark DIS capture default - */ - public static final int DEFAULT_MULTICAST_PORT = 3000; - - public enum NetworkMode { - UNICAST, MULTICAST, BROADCAST - }; - - /** - * Output prefix to identify this class, helps with logging - */ - private final static String TRACE_PREFIX = "[" + EspduSender.class.getName() + "] "; - - /** - * Possible system properties, passed in via -Dattr=val networkMode: - * unicast, broadcast, multicast destinationIp: where to send the packet. If - * in multicast mode, this can be multicast. To determine broadcast - * destination IP, use an online broadcast address calculator, for example - * http://www.remotemonitoringsystems.ca/broadcast.php If in multicast mode, - * a join() will be done on the multicast address. port: port used for both - * source and destination. - * - * @param args - */ - @SuppressWarnings("SleepWhileInLoop") // allows Thread.sleep(value) without warning in code - public static void main(String args[]) - { - System.out.println(TRACE_PREFIX + " started..."); - - // Default settings. These are used if no system properties are set. - // If system properties are passed in, these are overridden later. - NetworkMode networkMode = NetworkMode.MULTICAST; - InetAddress address = null; // must be initialized, even if null - int port = DEFAULT_MULTICAST_PORT; - MulticastSocket socket = null; // must be initialized to avoid later error, even if null; - EntityStatePdu espdu = new EntityStatePdu(); - DisTime disTime = new DisTime(); - - // ICBM coordinates for my office - double latitude = 36.639222; - double longitude = -121.803415; - try - { - address = InetAddress.getByName(DEFAULT_MULTICAST_ADDRESS); - } - catch (UnknownHostException e) - { - System.out.println(TRACE_PREFIX + e + " Cannot create multicast address"); - System.exit(0); - } - - // All system properties, passed in on the command line via -Dattribute=value - Properties systemProperties = System.getProperties(); - - // IP address we send to - String destinationIpString = systemProperties.getProperty("destinationIp"); - - // Port we send to, and local port we open the socket on - String portString = systemProperties.getProperty("port"); - - // Network mode: unicast, multicast, broadcast - String networkModeString = systemProperties.getProperty("networkMode"); // unicast or multicast or broadcast - - // Set up socket to send information - try - { - if (portString != null) // Update port we send to, if provided - { - port = Integer.parseInt(portString); - } - socket = new MulticastSocket(port); - - // Where we send packets to, the destination IP address - if (destinationIpString != null) - { - address = InetAddress.getByName(destinationIpString); - } - - // Type of transport: unicast, broadcast, or multicast - if (networkModeString != null) - { - if (networkModeString.equalsIgnoreCase("unicast")) - { - networkMode = NetworkMode.UNICAST; - } - else if (networkModeString.equalsIgnoreCase("broadcast")) - { - networkMode = NetworkMode.BROADCAST; - } - else if (networkModeString.equalsIgnoreCase("multicast")) - { - networkMode = NetworkMode.MULTICAST; - if (!address.isMulticastAddress()) - { - throw new RuntimeException("*** Error: sending to multicast address, but destination address " + address.toString() + "is not multicast"); - } - socket.joinGroup(address); // TODO select correct NetworkInterface - } - } // end networkModeString - else if (networkMode == NetworkMode.MULTICAST) - { - networkModeString = "multicast"; - } - else if (networkMode == NetworkMode.UNICAST) - { - networkModeString = "unicast"; - } - else if (networkMode == NetworkMode.BROADCAST) - { - networkModeString = "broadcast"; - } - } - catch (IOException | RuntimeException e) - { - System.out.println(TRACE_PREFIX + "Unable to initialize network correctly, exiting."); - System.out.println(e); - System.exit(-1); // outta here - } - System.out.println(TRACE_PREFIX + " sending " + networkModeString + " ESPDU packets to " + - address.getHostAddress() + " port " + port); - - // Initialize values in the Entity State PDU object. The exercise ID is - // a way to differentiate between different virtual worlds on one network. - // Note that some values (such as the PDU type and PDU family) are set - // automatically when you create the ESPDU. - espdu.setExerciseID((byte)1); //(short) 1); - - // The EID is the unique identifier for objects in the world. This - // EID should match up with the ID for the object specified in the - // VMRL/x3d/virtual world. - - EntityID entityID = espdu.getEntityID(); // initialize, reset, override - // TODO check: 0 is apparently not a valid site number, per DIS specification - entityID.setSiteID ((short)1); // TODO utility method to allow int values - entityID.setApplicationID((short)2); - entityID.setEntityID ((short)3); - espdu.setEntityID(entityID); // TODO utility method to allow setting all three at once - - // Set the entity type. SISO has a big list of enumerations, so that by - // specifying various numbers we can say this is an M1A2 American tank, - // the USS Enterprise, and so on. We'll make this a tank. There is a - // separate project elsehwhere in this project that implements DIS - // enumerations in C++ and Java, but to keep things simple we just use - // numbers here. - - // Manual way to override platform information: - EntityType entityType = espdu.getEntityType() - .setEntityKind (EntityKind.PLATFORM).setEntityKind (EntityKind.PLATFORM) //(short) 1); // Platform (vs lifeform, munition, sensor, etc.); //(short) 1); // Platform (vs lifeform, munition, sensor, etc.) - .setCountry (Country.UNITED_STATES_OF_AMERICA_USA) // 225 USA - .setDomain (Domain.inst(PlatformDomain.LAND)) // Land (vs air, surface, subsurface, space) - .setCategory ((byte) 7) // Large vic - .setSubCategory((byte) 39) // MTVR - .setSpecific ((byte) 2); // MTVR - - // New way using entity jar(s) - espdu.setEntityType(new edu.nps.moves.dis7.entities.usa.platform.land.MTVRMK25Cargo()); - // or simply use an enumeration by name, with accompanying import statement above - espdu.setEntityType(new MTVRMK25Cargo()); - - // Inspecting an enumeration - System.out.println("==============="); - System.out.println("espdu entityType information:"); - System.out.println(" EntityKind =" + espdu.getEntityType().getEntityKind()); - System.out.println(" Country =" + espdu.getEntityType().getCountry()); - System.out.println(" Domain =" + espdu.getEntityType().getDomain()); - System.out.println(" Category =" + espdu.getEntityType().getCategory()); - System.out.println(" SubCategory=" + espdu.getEntityType().getSubCategory()); - System.out.println(" Specific =" + espdu.getEntityType().getCountry()); - System.out.println("I am an MTVRMK25 Cargo Truck"); - // TODO round trip lookup - - Set<InetAddress> localNetworkAddresses; - - try // Loop through sending N ESPDUs - { - System.out.println(TRACE_PREFIX + "sending " + NUMBER_OF_LOOPS + " sets of packets:"); // + address.toString() - - for (int index = 0; index < NUMBER_OF_LOOPS; index++) - { - // DIS time is a pain in the uh, neck. DIS time units are 2^31-1 units per - // hour, and time is set to DIS time units from the top of the hour. - // This means that if you start sending just before the top of the hour - // the time units can roll over to zero as you are sending. The receivers - // (escpecially homegrown ones) are often not able to detect rollover - // and may start discarding packets as dupes or out of order. We use - // an NPS timestamp here, hundredths of a second since the start of the - // year. The DIS standard for time is often ignored in the wild; I've seen - // people use Unix time (seconds since 1970) and more. Or you can - // just stuff idx into the timestamp field to get something that is monotonically - // increasing. - - // Note that timestamp is used to detect duplicate and out of order packets. - // That means if you DON'T change the timestamp, many implementations will simply - // discard subsequent packets that have an identical timestamp. Also, if they - // receive a PDU with an timestamp lower than the last one they received, they - // may discard it as an earlier, out-of-order PDU. So it is a good idea to - // update the timestamp on ALL packets sent. - // An alterative approach: actually follow the standard. It's a crazy concept, - // but it might just work. - int timestamp = disTime.getDisAbsoluteTimestamp(); - espdu.setTimestamp(timestamp); - - // Set the position of the entity in the world. DIS uses a cartesian - // coordinate system with the origin at the center of the earth, the x - // axis out at the equator and prime meridian, y out at the equator and - // 90 deg east, and z up and out the north pole. To place an object on - // the earth's surface you also need a model for the shape of the earth - // (it's not a sphere.) All the fancy math necessary to do this is in - // the SEDRIS SRM package. There are also some one-off formulas for - // doing conversions from, for example, lat/lon/altitude to DIS coordinates. - // Here we use those one-off formulas. - // Modify the position of the object. This will send the object a little - // due east by adding some to the longitude every iteration. Since we - // are on the Pacific coast, this sends the object east. Assume we are - // at zero altitude. In other worlds you'd use DTED to determine the - // local ground altitude at that lat/lon, or you'd just use ground clamping. - // The x and y values will change, but the z value should not. - //lon = lon + (double)((double)idx / 100000.0); - //System.out.println("lla=" + lat + "," + lon + ", 0.0"); - double direction = Math.pow(-1.0, index); - longitude = longitude + (direction * 0.00006); - - double disCoordinates[] = CoordinateConversions.getXYZfromLatLonDegrees(latitude, longitude, 1.0); - Vector3Double location = espdu.getEntityLocation(); - location.setX(disCoordinates[0]); - location.setY(disCoordinates[1]); - location.setZ(disCoordinates[2]); - System.out.println("==============="); - System.out.println("Create new PDUs"); - System.out.println(" latitude, longitude: [" + latitude + ", " + longitude + "]"); - System.out.println(" coordinate conversion: [" + disCoordinates[0] + ", " + disCoordinates[1] + ", " + disCoordinates[2] + "]"); - - location = espdu.getEntityLocation(); - - System.out.println("Espdu #" + index + " entityID=[" + entityID.getSiteID()+ "," + entityID.getApplicationID()+ "," + entityID.getEntityID()+ "]"); - double c[] = {location.getX(), location.getY(), location.getZ()}; - double lla[] = CoordinateConversions.xyzToLatLonDegrees(c); -// System.out.println(" DIS entityLocation: [" + location.getX() + "," + location.getY() + "," + location.getZ() + "]"); - String debugString = " Location (latitude/longitude/altitude): [" + lla[0] + ", " + lla[1] + ", " + lla[2] + "]"; -// System.out.println(debugString); - - // Optionally, we can do some rotation of the entity - /* - Orientation orientation = espdu.getEntityOrientation(); - float psi = orientation.getPsi(); - psi = psi + idx; - orientation.setPsi(psi); - orientation.setTheta((float)(orientation.getTheta() + idx /2.0)); - */ - // You can set other ESPDU values here, such as the velocity, acceleration, - // and so on. - // Marshal out the espdu object to a byte array, then send a datagram - // packet with that data in it. - - double[] locOr = {location.getX(),location.getY(),location.getZ(), 5,6,1, 1,2,1, 0,0,0, 0,0,0}; - - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - DataOutputStream dos = new DataOutputStream(baos); - DatagramPacket packet; - - // The byte array here is the packet in DIS format. We put that into a - // datagram and send it. - espdu.marshal(dos); - byte[] espduArray = baos.toByteArray(); - - FirePdu firePdu = new FirePdu(); - firePdu.setLocationInWorldCoordinates(espdu.getEntityLocation()); - byte[] fireArray = firePdu.marshal(); - -// CommentPdu newCommentPdu = new CommentPdu(); -// ArrayList<VariableDatum> payloadList = new ArrayList<>(); -// ArrayList<String> commentsList = new ArrayList<>(); -// commentsList.add("Hello CommentPDU"); -// commentsList.add("Here is a second line of text in this comment."); -// if (!commentsList.isEmpty()) -// System.out.println("Preparing CommentPDU:"); -// -// for (String comment : commentsList) -// { -// VariableDatum newVariableDatum = new VariableDatum(); -// newVariableDatum.setVariableDatumValue (comment.getBytes()); // conversion -// newVariableDatum.setVariableDatumLengthInBytes(comment.getBytes().length); // also available in bits, see spec and javadoc -// // alternatively, you do not need to set this and the marshaller will figure it out from the byte array -// // (see javadoc for VariableDatum.setVariableDatumLength()) -// payloadList.add(newVariableDatum); -// System.out.println(" \"" + comment + "\""); -// } -// newCommentPdu.setVariableDatums(payloadList); -// byte[] commentArray = newCommentPdu.marshal(); - - localNetworkAddresses = getBroadcastAddresses(); - for (InetAddress networkAddress : localNetworkAddresses) { - if (espduArray.length > 0) - { - System.out.println(TRACE_PREFIX + "sending datagram packet [" + espdu.getPduType().toString() + "] to " + - String.format("%-15s", networkAddress.getHostAddress()) + " port " + port); - packet = new DatagramPacket(espduArray, espduArray.length, networkAddress, port); - socket.send(packet); - } - // TODO experiment with these! 8) - if (fireArray.length > 0) - { - System.out.println(TRACE_PREFIX + "sending datagram packet [" + firePdu.getPduType().toString() + " ] to " + - String.format("%-15s", networkAddress.getHostAddress()) + " port " + port); - packet = new DatagramPacket(fireArray, fireArray.length, networkAddress, port); // alternate - socket.send(packet); - } -// // TODO experiment with these! 8) -// if (newCommentPdu != null) -// { -// System.out.println(TRACE_PREFIX + "sending datagram packet [" + newCommentPdu.getPduType().toString() + " ] to " + -// String.format("%-15s", networkAddress.getHostAddress()) + " port " + port); -// packet = new DatagramPacket(commentArray, commentArray.length, networkAddress, port); // alternate -// socket.send(packet); -// } - } - // Send every 1 second within loop. Otherwise all this will be all over in a fraction of a second. - Thread.sleep(1000); // msec - } - } - catch (Exception e) - { - System.out.println(TRACE_PREFIX + "Problem with " + e + ", see exception trace:"); - System.out.println(e); - } - System.out.println("==============="); - System.out.println(TRACE_PREFIX + "complete."); - } - - /** - * A number of sites get all snippy about using 255.255.255.255 for a - * broadcast address; it trips their security software and they kick you off - * their network. (Comcast, NPS, etc.) This determines the broadcast address for - * all connected interfaces, based on the IP and subnet mask. If you have a - * dual-homed host it will return a broadcast address for both. If you have - * some VMs running on your host this will pick up the addresses for those - * as well--e.g. running VMWare on your laptop with a local IP this will also - * pick up a 192.168 address assigned to the VM by the host OS. - * - * @return set of all broadcast addresses - */ - public static Set<InetAddress> getBroadcastAddresses() - { - Set<InetAddress> broadcastAddresses = new HashSet<>(); - Enumeration interfaces; - - try { - interfaces = NetworkInterface.getNetworkInterfaces(); - - while (interfaces.hasMoreElements()) - { - NetworkInterface anInterface = (NetworkInterface) interfaces.nextElement(); - - if (anInterface.isUp()) - { - for (InterfaceAddress anAddress : anInterface.getInterfaceAddresses()) { - if ((anAddress == null || anAddress.getAddress().isLinkLocalAddress())) - { - continue; - } - - //System.out.println("Getting broadcast address for " + anAddress); - InetAddress broadcastAddress = anAddress.getBroadcast(); - if (broadcastAddress != null) - { - broadcastAddresses.add(broadcastAddress); - } - } - } - } - } - catch (SocketException e) - { - System.out.println(TRACE_PREFIX + "Problem with .getBroadcastAddresses(), see exception trace:" + e); - System.out.println(e); - } - return broadcastAddresses; - } -} +package OpenDis7Examples; + +import java.io.*; +import java.net.*; +import java.util.*; + +import edu.nps.moves.dis7.pdus.*; +import edu.nps.moves.dis7.enumerations.Country; +import edu.nps.moves.dis7.enumerations.EntityKind; +import edu.nps.moves.dis7.enumerations.PlatformDomain; +import edu.nps.moves.dis7.utilities.*; +import edu.nps.moves.dis7.entities.usa.platform.land.M1A2; +import edu.nps.moves.dis7.entities.usa.platform.land.MTVRMK25Cargo; + +/** + * Creates and sends ESPDUs in IEEE binary format. Adapted from OpenDIS library + * example package edu.nps.moves.examples + * + * @author Don McGregor + * @author Don Brutzman + */ +public class EspduSender +{ + /** + * Putting any upper limit on # packets sent avoids possibility of non-terminating infinite loops that continue sending packets. + */ + public static final int NUMBER_OF_LOOPS = 2; // 5 + + /** + * Default multicast group address we send on. + */ + public static final String DEFAULT_MULTICAST_ADDRESS = "239.1.2.3"; + + /** + * Default multicast port used, matches Wireshark DIS capture default + */ + public static final int DEFAULT_MULTICAST_PORT = 3000; + + public enum NetworkMode { + UNICAST, MULTICAST, BROADCAST + }; + + /** + * Output prefix to identify this class, helps with logging + */ + private final static String TRACE_PREFIX = "[" + EspduSender.class.getName() + "] "; + + /** + * Possible system properties, passed in via -Dattr=val networkMode: + * unicast, broadcast, multicast destinationIp: where to send the packet. If + * in multicast mode, this can be multicast. To determine broadcast + * destination IP, use an online broadcast address calculator, for example + * http://www.remotemonitoringsystems.ca/broadcast.php If in multicast mode, + * a join() will be done on the multicast address. port: port used for both + * source and destination. + * + * @param args command-line arguments + */ + @SuppressWarnings("SleepWhileInLoop") // allows Thread.sleep(value) without warning in code + public static void main(String args[]) + { + System.out.println(TRACE_PREFIX + " started..."); + + // Default settings. These are used if no system properties are set. + // If system properties are passed in, these are overridden later. + NetworkMode networkMode = NetworkMode.MULTICAST; + InetAddress address = null; // must be initialized, even if null + int port = DEFAULT_MULTICAST_PORT; + MulticastSocket socket = null; // must be initialized to avoid later error, even if null; + EntityStatePdu espdu = new EntityStatePdu(); + DisTime disTime = new DisTime(); + + // ICBM coordinates for my office + double latitude = 36.639222; + double longitude = -121.803415; + try + { + address = InetAddress.getByName(DEFAULT_MULTICAST_ADDRESS); + } + catch (UnknownHostException e) + { + System.out.println(TRACE_PREFIX + e + " Cannot create multicast address"); + System.exit(0); + } + + // All system properties, passed in on the command line via -Dattribute=value + Properties systemProperties = System.getProperties(); + + // IP address we send to + String destinationIpString = systemProperties.getProperty("destinationIp"); + + // Port we send to, and local port we open the socket on + String portString = systemProperties.getProperty("port"); + + // Network mode: unicast, multicast, broadcast + String networkModeString = systemProperties.getProperty("networkMode"); // unicast or multicast or broadcast + + // Set up socket to send information + try + { + if (portString != null) // Update port we send to, if provided + { + port = Integer.parseInt(portString); + } + socket = new MulticastSocket(port); + + // Where we send packets to, the destination IP address + if (destinationIpString != null) + { + address = InetAddress.getByName(destinationIpString); + } + + // Type of transport: unicast, broadcast, or multicast + if (networkModeString != null) + { + if (networkModeString.equalsIgnoreCase("unicast")) + { + networkMode = NetworkMode.UNICAST; + } + else if (networkModeString.equalsIgnoreCase("broadcast")) + { + networkMode = NetworkMode.BROADCAST; + } + else if (networkModeString.equalsIgnoreCase("multicast")) + { + networkMode = NetworkMode.MULTICAST; + if (!address.isMulticastAddress()) + { + throw new RuntimeException("*** Error: sending to multicast address, but destination address " + address.toString() + "is not multicast"); + } + socket.joinGroup(address); // TODO select correct NetworkInterface + } + } // end networkModeString + else if (networkMode == NetworkMode.MULTICAST) + { + networkModeString = "multicast"; + } + else if (networkMode == NetworkMode.UNICAST) + { + networkModeString = "unicast"; + } + else if (networkMode == NetworkMode.BROADCAST) + { + networkModeString = "broadcast"; + } + } + catch (IOException | RuntimeException e) + { + System.out.println(TRACE_PREFIX + "Unable to initialize network correctly, exiting."); + System.out.println(e); + System.exit(-1); // outta here + } + System.out.println(TRACE_PREFIX + " sending " + networkModeString + " ESPDU packets to " + + address.getHostAddress() + " port " + port); + + // Initialize values in the Entity State PDU object. The exercise ID is + // a way to differentiate between different virtual worlds on one network. + // Note that some values (such as the PDU type and PDU family) are set + // automatically when you create the ESPDU. + espdu.setExerciseID((byte)1); //(short) 1); + + // The EID is the unique identifier for objects in the world. This + // EID should match up with the ID for the object specified in the + // VMRL/x3d/virtual world. + + EntityID entityID = espdu.getEntityID(); // initialize, reset, override + // TODO check: 0 is apparently not a valid site number, per DIS specification + entityID.setSiteID ((short)1); // TODO utility method to allow int values + entityID.setApplicationID((short)2); + entityID.setEntityID ((short)3); + espdu.setEntityID(entityID); // TODO utility method to allow setting all three at once + + // Set the entity type. SISO has a big list of enumerations, so that by + // specifying various numbers we can say this is an M1A2 American tank, + // the USS Enterprise, and so on. We'll make this a tank. There is a + // separate project elsehwhere in this project that implements DIS + // enumerations in C++ and Java, but to keep things simple we just use + // numbers here. + + // Manual way to override platform information: + EntityType entityType = espdu.getEntityType() + .setEntityKind (EntityKind.PLATFORM).setEntityKind (EntityKind.PLATFORM) //(short) 1); // Platform (vs lifeform, munition, sensor, etc.); //(short) 1); // Platform (vs lifeform, munition, sensor, etc.) + .setCountry (Country.UNITED_STATES_OF_AMERICA_USA) // 225 USA + .setDomain (Domain.inst(PlatformDomain.LAND)) // Land (vs air, surface, subsurface, space) + .setCategory ((byte) 7) // Large vic + .setSubCategory((byte) 39) // MTVR + .setSpecific ((byte) 2); // MTVR + + // New way using entity jar(s) + espdu.setEntityType(new edu.nps.moves.dis7.entities.usa.platform.land.MTVRMK25Cargo()); + // or simply use an enumeration by name, with accompanying import statement above + espdu.setEntityType(new MTVRMK25Cargo()); + + // Inspecting an enumeration + System.out.println("==============="); + System.out.println("espdu entityType information:"); + System.out.println(" EntityKind =" + espdu.getEntityType().getEntityKind()); + System.out.println(" Country =" + espdu.getEntityType().getCountry()); + System.out.println(" Domain =" + espdu.getEntityType().getDomain()); + System.out.println(" Category =" + espdu.getEntityType().getCategory()); + System.out.println(" SubCategory=" + espdu.getEntityType().getSubCategory()); + System.out.println(" Specific =" + espdu.getEntityType().getCountry()); + System.out.println("I am an MTVRMK25 Cargo Truck"); + // TODO round trip lookup + + Set<InetAddress> localNetworkAddresses; + + try // Loop through sending N ESPDUs + { + System.out.println(TRACE_PREFIX + "sending " + NUMBER_OF_LOOPS + " sets of packets:"); // + address.toString() + + for (int index = 0; index < NUMBER_OF_LOOPS; index++) + { + // DIS time is a pain in the uh, neck. DIS time units are 2^31-1 units per + // hour, and time is set to DIS time units from the top of the hour. + // This means that if you start sending just before the top of the hour + // the time units can roll over to zero as you are sending. The receivers + // (escpecially homegrown ones) are often not able to detect rollover + // and may start discarding packets as dupes or out of order. We use + // an NPS timestamp here, hundredths of a second since the start of the + // year. The DIS standard for time is often ignored in the wild; I've seen + // people use Unix time (seconds since 1970) and more. Or you can + // just stuff idx into the timestamp field to get something that is monotonically + // increasing. + + // Note that timestamp is used to detect duplicate and out of order packets. + // That means if you DON'T change the timestamp, many implementations will simply + // discard subsequent packets that have an identical timestamp. Also, if they + // receive a PDU with an timestamp lower than the last one they received, they + // may discard it as an earlier, out-of-order PDU. So it is a good idea to + // update the timestamp on ALL packets sent. + // An alterative approach: actually follow the standard. It's a crazy concept, + // but it might just work. + int timestamp = disTime.getDisAbsoluteTimestamp(); + espdu.setTimestamp(timestamp); + + // Set the position of the entity in the world. DIS uses a cartesian + // coordinate system with the origin at the center of the earth, the x + // axis out at the equator and prime meridian, y out at the equator and + // 90 deg east, and z up and out the north pole. To place an object on + // the earth's surface you also need a model for the shape of the earth + // (it's not a sphere.) All the fancy math necessary to do this is in + // the SEDRIS SRM package. There are also some one-off formulas for + // doing conversions from, for example, lat/lon/altitude to DIS coordinates. + // Here we use those one-off formulas. + // Modify the position of the object. This will send the object a little + // due east by adding some to the longitude every iteration. Since we + // are on the Pacific coast, this sends the object east. Assume we are + // at zero altitude. In other worlds you'd use DTED to determine the + // local ground altitude at that lat/lon, or you'd just use ground clamping. + // The x and y values will change, but the z value should not. + //lon = lon + (double)((double)idx / 100000.0); + //System.out.println("lla=" + lat + "," + lon + ", 0.0"); + double direction = Math.pow(-1.0, index); + longitude = longitude + (direction * 0.00006); + + double disCoordinates[] = CoordinateConversions.getXYZfromLatLonDegrees(latitude, longitude, 1.0); + Vector3Double location = espdu.getEntityLocation(); + location.setX(disCoordinates[0]); + location.setY(disCoordinates[1]); + location.setZ(disCoordinates[2]); + System.out.println("==============="); + System.out.println("Create new PDUs"); + System.out.println(" latitude, longitude: [" + latitude + ", " + longitude + "]"); + System.out.println(" coordinate conversion: [" + disCoordinates[0] + ", " + disCoordinates[1] + ", " + disCoordinates[2] + "]"); + + location = espdu.getEntityLocation(); + + System.out.println("Espdu #" + index + " entityID=[" + entityID.getSiteID()+ "," + entityID.getApplicationID()+ "," + entityID.getEntityID()+ "]"); + double c[] = {location.getX(), location.getY(), location.getZ()}; + double lla[] = CoordinateConversions.xyzToLatLonDegrees(c); +// System.out.println(" DIS entityLocation: [" + location.getX() + "," + location.getY() + "," + location.getZ() + "]"); + String debugString = " Location (latitude/longitude/altitude): [" + lla[0] + ", " + lla[1] + ", " + lla[2] + "]"; +// System.out.println(debugString); + + // Optionally, we can do some rotation of the entity + /* + Orientation orientation = espdu.getEntityOrientation(); + float psi = orientation.getPsi(); + psi = psi + idx; + orientation.setPsi(psi); + orientation.setTheta((float)(orientation.getTheta() + idx /2.0)); + */ + // You can set other ESPDU values here, such as the velocity, acceleration, + // and so on. + // Marshal out the espdu object to a byte array, then send a datagram + // packet with that data in it. + + double[] locOr = {location.getX(),location.getY(),location.getZ(), 5,6,1, 1,2,1, 0,0,0, 0,0,0}; + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + DataOutputStream dos = new DataOutputStream(baos); + DatagramPacket packet; + + // The byte array here is the packet in DIS format. We put that into a + // datagram and send it. + espdu.marshal(dos); + byte[] espduArray = baos.toByteArray(); + + FirePdu firePdu = new FirePdu(); + firePdu.setLocationInWorldCoordinates(espdu.getEntityLocation()); + byte[] fireArray = firePdu.marshal(); + +// CommentPdu newCommentPdu = new CommentPdu(); +// ArrayList<VariableDatum> payloadList = new ArrayList<>(); +// ArrayList<String> commentsList = new ArrayList<>(); +// commentsList.add("Hello CommentPDU"); +// commentsList.add("Here is a second line of text in this comment."); +// if (!commentsList.isEmpty()) +// System.out.println("Preparing CommentPDU:"); +// +// for (String comment : commentsList) +// { +// VariableDatum newVariableDatum = new VariableDatum(); +// newVariableDatum.setVariableDatumValue (comment.getBytes()); // conversion +// newVariableDatum.setVariableDatumLengthInBytes(comment.getBytes().length); // also available in bits, see spec and javadoc +// // alternatively, you do not need to set this and the marshaller will figure it out from the byte array +// // (see javadoc for VariableDatum.setVariableDatumLength()) +// payloadList.add(newVariableDatum); +// System.out.println(" \"" + comment + "\""); +// } +// newCommentPdu.setVariableDatums(payloadList); +// byte[] commentArray = newCommentPdu.marshal(); + + localNetworkAddresses = getBroadcastAddresses(); + for (InetAddress networkAddress : localNetworkAddresses) { + if (espduArray.length > 0) + { + System.out.println(TRACE_PREFIX + "sending datagram packet [" + espdu.getPduType().toString() + "] to " + + String.format("%-15s", networkAddress.getHostAddress()) + " port " + port); + packet = new DatagramPacket(espduArray, espduArray.length, networkAddress, port); + socket.send(packet); + } + // TODO experiment with these! 8) + if (fireArray.length > 0) + { + System.out.println(TRACE_PREFIX + "sending datagram packet [" + firePdu.getPduType().toString() + " ] to " + + String.format("%-15s", networkAddress.getHostAddress()) + " port " + port); + packet = new DatagramPacket(fireArray, fireArray.length, networkAddress, port); // alternate + socket.send(packet); + } +// // TODO experiment with these! 8) +// if (newCommentPdu != null) +// { +// System.out.println(TRACE_PREFIX + "sending datagram packet [" + newCommentPdu.getPduType().toString() + " ] to " + +// String.format("%-15s", networkAddress.getHostAddress()) + " port " + port); +// packet = new DatagramPacket(commentArray, commentArray.length, networkAddress, port); // alternate +// socket.send(packet); +// } + } + // Send every 1 second within loop. Otherwise all this will be all over in a fraction of a second. + Thread.sleep(1000); // msec + } + } + catch (Exception e) + { + System.out.println(TRACE_PREFIX + "Problem with " + e + ", see exception trace:"); + System.out.println(e); + } + System.out.println("==============="); + System.out.println(TRACE_PREFIX + "complete."); + } + + /** + * A number of sites get all snippy about using 255.255.255.255 for a + * broadcast address; it trips their security software and they kick you off + * their network. (Comcast, NPS, etc.) This determines the broadcast address for + * all connected interfaces, based on the IP and subnet mask. If you have a + * dual-homed host it will return a broadcast address for both. If you have + * some VMs running on your host this will pick up the addresses for those + * as well--e.g. running VMWare on your laptop with a local IP this will also + * pick up a 192.168 address assigned to the VM by the host OS. + * + * @return set of all broadcast addresses + */ + public static Set<InetAddress> getBroadcastAddresses() + { + Set<InetAddress> broadcastAddresses = new HashSet<>(); + Enumeration interfaces; + + try { + interfaces = NetworkInterface.getNetworkInterfaces(); + + while (interfaces.hasMoreElements()) + { + NetworkInterface anInterface = (NetworkInterface) interfaces.nextElement(); + + if (anInterface.isUp()) + { + for (InterfaceAddress anAddress : anInterface.getInterfaceAddresses()) { + if ((anAddress == null || anAddress.getAddress().isLinkLocalAddress())) + { + continue; + } + + //System.out.println("Getting broadcast address for " + anAddress); + InetAddress broadcastAddress = anAddress.getBroadcast(); + if (broadcastAddress != null) + { + broadcastAddresses.add(broadcastAddress); + } + } + } + } + } + catch (SocketException e) + { + System.out.println(TRACE_PREFIX + "Problem with .getBroadcastAddresses(), see exception trace:" + e); + System.out.println(e); + } + return broadcastAddresses; + } +} diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework4/Britt/PDUReciever.java b/assignments/src/MV3500Cohort2020JulySeptember/homework4/Britt/PDUReciever.java index 5ab4c55cfd26e8629ba58a195b819a1c0d3c3fbe..8385e792ed1bea721c2c18a2a8d04122ce07becb 100644 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework4/Britt/PDUReciever.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework4/Britt/PDUReciever.java @@ -1,128 +1,128 @@ -package MV3500Cohort2020JulySeptember.homework4.White; - -import MV3500Cohort2020JulySeptember.homework4.White.working.*; -import java.io.*; -import java.net.*; -import java.util.*; - -import edu.nps.moves.dis7.pdus.*; -import edu.nps.moves.dis7.utilities.*; - -/** - * Receives PDUs from GermanyEspduReceiverEspduVPNSender in IEEE DIS format. - * - * @date 09/05/2020 - * @author Bernd/Stefan - * @version 0.1 - */ -public class PDUReciever { - - /** - * Max size of a PDU in binary format that we can receive. This is actually - * somewhat outdated--PDUs can be larger--but this is a reasonable starting - * point. - */ - public static final int MAX_PDU_SIZE = 8192; - - /** - * Default port used, matches Wireshark DIS capture default - */ - public static final int DEFAULT_PORT = 2317; - public static final int SECOND_PORT = 3000; - public static final int THIRD_PORT = 2318; - - - /** - * Output prefix to identify this class - */ - private final static String TRACE_PREFIX = "[" + PDUReciever.class.getName() + "] "; - - public static void main(String args[]) { - System.out.println(TRACE_PREFIX + "started..."); - - MulticastSocket socket1; - MulticastSocket socket2; - MulticastSocket socket3; - DatagramPacket packet; - DatagramPacket packet2; - DatagramPacket packet3; - PduFactory pduFactory = new PduFactory(); - ArrayList<EntityID> knownEntities = new ArrayList<EntityID>(); - int pduCount = 0; - - try { - // Specify the socket to receive data - socket1 = new MulticastSocket(DEFAULT_PORT); - socket2 = new MulticastSocket(SECOND_PORT); - socket3 = new MulticastSocket(THIRD_PORT); - - System.out.println(TRACE_PREFIX + "listening for PDU packets on port " + DEFAULT_PORT );//+ " " + SECOND_PORT + " " + THIRD_PORT); - System.out.println("===================================================="); - - while (true) // Loop infinitely, receiving datagrams - { - byte buffer[] = new byte[MAX_PDU_SIZE]; - packet = new DatagramPacket(buffer, buffer.length); - - socket1.receive(packet); - - - - List<Pdu> pduBundle = pduFactory.getPdusFromBundle(packet.getData(), packet.getLength()); - if (pduBundle.size() > 1) { // should be 1 for this project - System.out.println("Bundle size is " + pduBundle.size()); - } - - // end iterator loop through PDU bundle - for (Pdu aPdu : pduBundle) { - pduCount++; - String receiptMessage = String.format("%3s", pduCount) // right justify, 3 characters - + ". received PDU type " + aPdu.getPduType().getValue() + "=" + aPdu.getPduType().name() + " " + aPdu.getClass().getName() + " from " + packet.getAddress(); - if (aPdu instanceof EntityStatePdu) { - System.out.println(receiptMessage); - EntityID entityID = ((EntityStatePdu) aPdu).getEntityID(); - Vector3Double position = ((EntityStatePdu) aPdu).getEntityLocation(); - System.out.println(" entityID triplet: [" + entityID.getSiteID() + ", " + entityID.getApplicationID() + ", " + entityID.getEntityID() + "] "); - if (!knownEntities.contains(entityID)){ - knownEntities.add(entityID); - EntityType entityType = ((EntityStatePdu) aPdu).getEntityType(); - System.out.println(" New Entity: " +entityType.getEntityKind() + " "+ entityType.getDomain() + " "+ entityType.getCountry() + " "+ entityType.getCategory() + " "+ entityType.getSubCategory() + " "+ entityType.getSpecific() ); - } - System.out.println(" Location in DIS coordinates: [" + position.getX() + ", " + position.getY() + ", " + position.getZ() + "]"); - - } - else if (aPdu instanceof FirePdu){ - System.out.println(receiptMessage); - EntityID firingEntityID = ((FirePdu) aPdu).getFiringEntityID(); - EntityID targetEntityID = ((FirePdu) aPdu).getTargetEntityID(); - MunitionDescriptor munitionDescriptor = ((FirePdu) aPdu).getDescriptor(); - System.out.println(" firingEntityID triplet: [" + firingEntityID.getSiteID() + ", " + firingEntityID.getApplicationID() + ", " + firingEntityID.getEntityID() + "] "); - System.out.println(" targetEntityID triplet: [" + targetEntityID.getSiteID() + ", " + targetEntityID.getApplicationID() + ", " + targetEntityID.getEntityID() + "] "); - System.out.println(" Munition Information: [" + munitionDescriptor.getMunitionType().getDomain() + "."+munitionDescriptor.getMunitionType().getCountry() + "." + munitionDescriptor.getMunitionType().getCategory() + "."+ munitionDescriptor.getMunitionType().getSubCategory() + "." + munitionDescriptor.getMunitionType().getSpecific() + "]"); - } - else if (aPdu instanceof CommentReliablePdu){ - System.out.println(receiptMessage); - ArrayList<VariableDatum> payloadList = (ArrayList)((CommentReliablePdu) aPdu).getVariableDatumRecords(); - if (!payloadList.isEmpty()) - System.out.print (" messages: "); - for (VariableDatum variableDatum : payloadList) - { - String nextComment = new String(variableDatum.getVariableDatumValue()); // convert byte[] to String - System.out.print (" \"" + nextComment + "\""); - System.out.println(); - } - } //OTHER PDU TYPES - else { - System.out.println(receiptMessage); - } - } // end of bundle loop - - } // end of while loop - } // end try block // end try block // end try block // end try block - catch (IOException ioe) { - System.out.println(TRACE_PREFIX + "Problem with input/output, see exception trace:"); - System.out.println(ioe); - } - System.out.println(TRACE_PREFIX + "complete."); - } // end main -} // end class +package MV3500Cohort2020JulySeptember.homework4.White; + +import MV3500Cohort2020JulySeptember.homework4.White.working.*; +import java.io.*; +import java.net.*; +import java.util.*; + +import edu.nps.moves.dis7.pdus.*; +import edu.nps.moves.dis7.utilities.*; + +/** + * Receives PDUs from GermanyEspduReceiverEspduVPNSender in IEEE DIS format. + * + * @version 09/05/2020 + * @author Bernd/Stefan + * @version 0.1 + */ +public class PDUReciever { + + /** + * Max size of a PDU in binary format that we can receive. This is actually + * somewhat outdated--PDUs can be larger--but this is a reasonable starting + * point. + */ + public static final int MAX_PDU_SIZE = 8192; + + /** + * Default port used, matches Wireshark DIS capture default + */ + public static final int DEFAULT_PORT = 2317; + public static final int SECOND_PORT = 3000; + public static final int THIRD_PORT = 2318; + + + /** + * Output prefix to identify this class + */ + private final static String TRACE_PREFIX = "[" + PDUReciever.class.getName() + "] "; + + public static void main(String args[]) { + System.out.println(TRACE_PREFIX + "started..."); + + MulticastSocket socket1; + MulticastSocket socket2; + MulticastSocket socket3; + DatagramPacket packet; + DatagramPacket packet2; + DatagramPacket packet3; + PduFactory pduFactory = new PduFactory(); + ArrayList<EntityID> knownEntities = new ArrayList<EntityID>(); + int pduCount = 0; + + try { + // Specify the socket to receive data + socket1 = new MulticastSocket(DEFAULT_PORT); + socket2 = new MulticastSocket(SECOND_PORT); + socket3 = new MulticastSocket(THIRD_PORT); + + System.out.println(TRACE_PREFIX + "listening for PDU packets on port " + DEFAULT_PORT );//+ " " + SECOND_PORT + " " + THIRD_PORT); + System.out.println("===================================================="); + + while (true) // Loop infinitely, receiving datagrams + { + byte buffer[] = new byte[MAX_PDU_SIZE]; + packet = new DatagramPacket(buffer, buffer.length); + + socket1.receive(packet); + + + + List<Pdu> pduBundle = pduFactory.getPdusFromBundle(packet.getData(), packet.getLength()); + if (pduBundle.size() > 1) { // should be 1 for this project + System.out.println("Bundle size is " + pduBundle.size()); + } + + // end iterator loop through PDU bundle + for (Pdu aPdu : pduBundle) { + pduCount++; + String receiptMessage = String.format("%3s", pduCount) // right justify, 3 characters + + ". received PDU type " + aPdu.getPduType().getValue() + "=" + aPdu.getPduType().name() + " " + aPdu.getClass().getName() + " from " + packet.getAddress(); + if (aPdu instanceof EntityStatePdu) { + System.out.println(receiptMessage); + EntityID entityID = ((EntityStatePdu) aPdu).getEntityID(); + Vector3Double position = ((EntityStatePdu) aPdu).getEntityLocation(); + System.out.println(" entityID triplet: [" + entityID.getSiteID() + ", " + entityID.getApplicationID() + ", " + entityID.getEntityID() + "] "); + if (!knownEntities.contains(entityID)){ + knownEntities.add(entityID); + EntityType entityType = ((EntityStatePdu) aPdu).getEntityType(); + System.out.println(" New Entity: " +entityType.getEntityKind() + " "+ entityType.getDomain() + " "+ entityType.getCountry() + " "+ entityType.getCategory() + " "+ entityType.getSubCategory() + " "+ entityType.getSpecific() ); + } + System.out.println(" Location in DIS coordinates: [" + position.getX() + ", " + position.getY() + ", " + position.getZ() + "]"); + + } + else if (aPdu instanceof FirePdu){ + System.out.println(receiptMessage); + EntityID firingEntityID = ((FirePdu) aPdu).getFiringEntityID(); + EntityID targetEntityID = ((FirePdu) aPdu).getTargetEntityID(); + MunitionDescriptor munitionDescriptor = ((FirePdu) aPdu).getDescriptor(); + System.out.println(" firingEntityID triplet: [" + firingEntityID.getSiteID() + ", " + firingEntityID.getApplicationID() + ", " + firingEntityID.getEntityID() + "] "); + System.out.println(" targetEntityID triplet: [" + targetEntityID.getSiteID() + ", " + targetEntityID.getApplicationID() + ", " + targetEntityID.getEntityID() + "] "); + System.out.println(" Munition Information: [" + munitionDescriptor.getMunitionType().getDomain() + "."+munitionDescriptor.getMunitionType().getCountry() + "." + munitionDescriptor.getMunitionType().getCategory() + "."+ munitionDescriptor.getMunitionType().getSubCategory() + "." + munitionDescriptor.getMunitionType().getSpecific() + "]"); + } + else if (aPdu instanceof CommentReliablePdu){ + System.out.println(receiptMessage); + ArrayList<VariableDatum> payloadList = (ArrayList)((CommentReliablePdu) aPdu).getVariableDatumRecords(); + if (!payloadList.isEmpty()) + System.out.print (" messages: "); + for (VariableDatum variableDatum : payloadList) + { + String nextComment = new String(variableDatum.getVariableDatumValue()); // convert byte[] to String + System.out.print (" \"" + nextComment + "\""); + System.out.println(); + } + } //OTHER PDU TYPES + else { + System.out.println(receiptMessage); + } + } // end of bundle loop + + } // end of while loop + } // end try block // end try block // end try block // end try block + catch (IOException ioe) { + System.out.println(TRACE_PREFIX + "Problem with input/output, see exception trace:"); + System.out.println(ioe); + } + System.out.println(TRACE_PREFIX + "complete."); + } // end main +} // end class diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework4/Cannon/PDUReciever.java b/assignments/src/MV3500Cohort2020JulySeptember/homework4/Cannon/PDUReciever.java index 6a601f054ecbf0077a875085a05f2df6b1b654d1..6c36beb069a40be1f02bca92d934fdcf993329a9 100755 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework4/Cannon/PDUReciever.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework4/Cannon/PDUReciever.java @@ -1,128 +1,128 @@ -package MV3500Cohort2020JulySeptember.homework4.Cannon; - -import MV3500Cohort2020JulySeptember.homework4.White.working.*; -import java.io.*; -import java.net.*; -import java.util.*; - -import edu.nps.moves.dis7.pdus.*; -import edu.nps.moves.dis7.utilities.*; - -/** - * Receives PDUs from GermanyEspduReceiverEspduVPNSender in IEEE DIS format. - * - * @date 09/05/2020 - * @author Bernd/Stefan - * @version 0.1 - */ -public class PDUReciever { - - /** - * Max size of a PDU in binary format that we can receive. This is actually - * somewhat outdated--PDUs can be larger--but this is a reasonable starting - * point. - */ - public static final int MAX_PDU_SIZE = 8192; - - /** - * Default port used, matches Wireshark DIS capture default - */ - public static final int DEFAULT_PORT = 2317; - public static final int SECOND_PORT = 3000; - public static final int THIRD_PORT = 2318; - - - /** - * Output prefix to identify this class - */ - private final static String TRACE_PREFIX = "[" + PDUReciever.class.getName() + "] "; - - public static void main(String args[]) { - System.out.println(TRACE_PREFIX + "started..."); - - MulticastSocket socket1; - MulticastSocket socket2; - MulticastSocket socket3; - DatagramPacket packet; - DatagramPacket packet2; - DatagramPacket packet3; - PduFactory pduFactory = new PduFactory(); - ArrayList<EntityID> knownEntities = new ArrayList<EntityID>(); - int pduCount = 0; - - try { - // Specify the socket to receive data - socket1 = new MulticastSocket(DEFAULT_PORT); - socket2 = new MulticastSocket(SECOND_PORT); - socket3 = new MulticastSocket(THIRD_PORT); - - System.out.println(TRACE_PREFIX + "listening for PDU packets on port " + DEFAULT_PORT );//+ " " + SECOND_PORT + " " + THIRD_PORT); - System.out.println("===================================================="); - - while (true) // Loop infinitely, receiving datagrams - { - byte buffer[] = new byte[MAX_PDU_SIZE]; - packet = new DatagramPacket(buffer, buffer.length); - - socket1.receive(packet); - - - - List<Pdu> pduBundle = pduFactory.getPdusFromBundle(packet.getData(), packet.getLength()); - if (pduBundle.size() > 1) { // should be 1 for this project - System.out.println("Bundle size is " + pduBundle.size()); - } - - // end iterator loop through PDU bundle - for (Pdu aPdu : pduBundle) { - pduCount++; - String receiptMessage = String.format("%3s", pduCount) // right justify, 3 characters - + ". received PDU type " + aPdu.getPduType().getValue() + "=" + aPdu.getPduType().name() + " " + aPdu.getClass().getName() + " from " + packet.getAddress(); - if (aPdu instanceof EntityStatePdu) { - System.out.println(receiptMessage); - EntityID entityID = ((EntityStatePdu) aPdu).getEntityID(); - Vector3Double position = ((EntityStatePdu) aPdu).getEntityLocation(); - System.out.println(" entityID triplet: [" + entityID.getSiteID() + ", " + entityID.getApplicationID() + ", " + entityID.getEntityID() + "] "); - if (!knownEntities.contains(entityID)){ - knownEntities.add(entityID); - EntityType entityType = ((EntityStatePdu) aPdu).getEntityType(); - System.out.println(" New Entity: " +entityType.getEntityKind() + " "+ entityType.getDomain() + " "+ entityType.getCountry() + " "+ entityType.getCategory() + " "+ entityType.getSubCategory() + " "+ entityType.getSpecific() ); - } - System.out.println(" Location in DIS coordinates: [" + position.getX() + ", " + position.getY() + ", " + position.getZ() + "]"); - - } - else if (aPdu instanceof FirePdu){ - System.out.println(receiptMessage); - EntityID firingEntityID = ((FirePdu) aPdu).getFiringEntityID(); - EntityID targetEntityID = ((FirePdu) aPdu).getTargetEntityID(); - MunitionDescriptor munitionDescriptor = ((FirePdu) aPdu).getDescriptor(); - System.out.println(" firingEntityID triplet: [" + firingEntityID.getSiteID() + ", " + firingEntityID.getApplicationID() + ", " + firingEntityID.getEntityID() + "] "); - System.out.println(" targetEntityID triplet: [" + targetEntityID.getSiteID() + ", " + targetEntityID.getApplicationID() + ", " + targetEntityID.getEntityID() + "] "); - System.out.println(" Munition Information: [" + munitionDescriptor.getMunitionType().getDomain() + "."+munitionDescriptor.getMunitionType().getCountry() + "." + munitionDescriptor.getMunitionType().getCategory() + "."+ munitionDescriptor.getMunitionType().getSubCategory() + "." + munitionDescriptor.getMunitionType().getSpecific() + "." + munitionDescriptor.getMunitionType().getExtra() + "]"); - } - else if (aPdu instanceof CommentReliablePdu){ - System.out.println(receiptMessage); - ArrayList<VariableDatum> payloadList = (ArrayList)((CommentReliablePdu) aPdu).getVariableDatumRecords(); - if (!payloadList.isEmpty()) - System.out.print (" messages: "); - for (VariableDatum variableDatum : payloadList) - { - String nextComment = new String(variableDatum.getVariableDatumValue()); // convert byte[] to String - System.out.print (" \"" + nextComment + "\""); - System.out.println(); - } - } //OTHER PDU TYPES - else { - System.out.println(receiptMessage); - } - } // end of bundle loop - - } // end of while loop - } // end try block // end try block // end try block // end try block - catch (IOException ioe) { - System.out.println(TRACE_PREFIX + "Problem with input/output, see exception trace:"); - System.out.println(ioe); - } - System.out.println(TRACE_PREFIX + "complete."); - } // end main -} // end class +package MV3500Cohort2020JulySeptember.homework4.Cannon; + +import MV3500Cohort2020JulySeptember.homework4.White.working.*; +import java.io.*; +import java.net.*; +import java.util.*; + +import edu.nps.moves.dis7.pdus.*; +import edu.nps.moves.dis7.utilities.*; + +/** + * Receives PDUs from GermanyEspduReceiverEspduVPNSender in IEEE DIS format. + * + * @version 09/05/2020 + * @author Bernd/Stefan + * @version 0.1 + */ +public class PDUReciever { + + /** + * Max size of a PDU in binary format that we can receive. This is actually + * somewhat outdated--PDUs can be larger--but this is a reasonable starting + * point. + */ + public static final int MAX_PDU_SIZE = 8192; + + /** + * Default port used, matches Wireshark DIS capture default + */ + public static final int DEFAULT_PORT = 2317; + public static final int SECOND_PORT = 3000; + public static final int THIRD_PORT = 2318; + + + /** + * Output prefix to identify this class + */ + private final static String TRACE_PREFIX = "[" + PDUReciever.class.getName() + "] "; + + public static void main(String args[]) { + System.out.println(TRACE_PREFIX + "started..."); + + MulticastSocket socket1; + MulticastSocket socket2; + MulticastSocket socket3; + DatagramPacket packet; + DatagramPacket packet2; + DatagramPacket packet3; + PduFactory pduFactory = new PduFactory(); + ArrayList<EntityID> knownEntities = new ArrayList<EntityID>(); + int pduCount = 0; + + try { + // Specify the socket to receive data + socket1 = new MulticastSocket(DEFAULT_PORT); + socket2 = new MulticastSocket(SECOND_PORT); + socket3 = new MulticastSocket(THIRD_PORT); + + System.out.println(TRACE_PREFIX + "listening for PDU packets on port " + DEFAULT_PORT );//+ " " + SECOND_PORT + " " + THIRD_PORT); + System.out.println("===================================================="); + + while (true) // Loop infinitely, receiving datagrams + { + byte buffer[] = new byte[MAX_PDU_SIZE]; + packet = new DatagramPacket(buffer, buffer.length); + + socket1.receive(packet); + + + + List<Pdu> pduBundle = pduFactory.getPdusFromBundle(packet.getData(), packet.getLength()); + if (pduBundle.size() > 1) { // should be 1 for this project + System.out.println("Bundle size is " + pduBundle.size()); + } + + // end iterator loop through PDU bundle + for (Pdu aPdu : pduBundle) { + pduCount++; + String receiptMessage = String.format("%3s", pduCount) // right justify, 3 characters + + ". received PDU type " + aPdu.getPduType().getValue() + "=" + aPdu.getPduType().name() + " " + aPdu.getClass().getName() + " from " + packet.getAddress(); + if (aPdu instanceof EntityStatePdu) { + System.out.println(receiptMessage); + EntityID entityID = ((EntityStatePdu) aPdu).getEntityID(); + Vector3Double position = ((EntityStatePdu) aPdu).getEntityLocation(); + System.out.println(" entityID triplet: [" + entityID.getSiteID() + ", " + entityID.getApplicationID() + ", " + entityID.getEntityID() + "] "); + if (!knownEntities.contains(entityID)){ + knownEntities.add(entityID); + EntityType entityType = ((EntityStatePdu) aPdu).getEntityType(); + System.out.println(" New Entity: " +entityType.getEntityKind() + " "+ entityType.getDomain() + " "+ entityType.getCountry() + " "+ entityType.getCategory() + " "+ entityType.getSubCategory() + " "+ entityType.getSpecific() ); + } + System.out.println(" Location in DIS coordinates: [" + position.getX() + ", " + position.getY() + ", " + position.getZ() + "]"); + + } + else if (aPdu instanceof FirePdu){ + System.out.println(receiptMessage); + EntityID firingEntityID = ((FirePdu) aPdu).getFiringEntityID(); + EntityID targetEntityID = ((FirePdu) aPdu).getTargetEntityID(); + MunitionDescriptor munitionDescriptor = ((FirePdu) aPdu).getDescriptor(); + System.out.println(" firingEntityID triplet: [" + firingEntityID.getSiteID() + ", " + firingEntityID.getApplicationID() + ", " + firingEntityID.getEntityID() + "] "); + System.out.println(" targetEntityID triplet: [" + targetEntityID.getSiteID() + ", " + targetEntityID.getApplicationID() + ", " + targetEntityID.getEntityID() + "] "); + System.out.println(" Munition Information: [" + munitionDescriptor.getMunitionType().getDomain() + "."+munitionDescriptor.getMunitionType().getCountry() + "." + munitionDescriptor.getMunitionType().getCategory() + "."+ munitionDescriptor.getMunitionType().getSubCategory() + "." + munitionDescriptor.getMunitionType().getSpecific() + "." + munitionDescriptor.getMunitionType().getExtra() + "]"); + } + else if (aPdu instanceof CommentReliablePdu){ + System.out.println(receiptMessage); + ArrayList<VariableDatum> payloadList = (ArrayList)((CommentReliablePdu) aPdu).getVariableDatumRecords(); + if (!payloadList.isEmpty()) + System.out.print (" messages: "); + for (VariableDatum variableDatum : payloadList) + { + String nextComment = new String(variableDatum.getVariableDatumValue()); // convert byte[] to String + System.out.print (" \"" + nextComment + "\""); + System.out.println(); + } + } //OTHER PDU TYPES + else { + System.out.println(receiptMessage); + } + } // end of bundle loop + + } // end of while loop + } // end try block // end try block // end try block // end try block + catch (IOException ioe) { + System.out.println(TRACE_PREFIX + "Problem with input/output, see exception trace:"); + System.out.println(ioe); + } + System.out.println(TRACE_PREFIX + "complete."); + } // end main +} // end class diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework4/WeissenbergerGoericke/GermanyEspduReceiverEspduVPNSender.java b/assignments/src/MV3500Cohort2020JulySeptember/homework4/WeissenbergerGoericke/GermanyEspduReceiverEspduVPNSender.java index 21e958d84e48e335fc9c9408a2520314cea12f12..aca45ac377f263df4e88c057ba5eabb7d46610a3 100755 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework4/WeissenbergerGoericke/GermanyEspduReceiverEspduVPNSender.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework4/WeissenbergerGoericke/GermanyEspduReceiverEspduVPNSender.java @@ -13,7 +13,7 @@ import java.util.logging.Logger; * Receives PDUs from mobile devise in IEEE DIS format. Send it over VPN (argon) * to Stefan's PDU Receiver * - * @date 09/05/2020 + * @version 09/05/2020 * @author Bernd/Stefan * @version 0.1 */ diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework4/WeissenbergerGoericke/GermanyEspduVPNReceiver.java b/assignments/src/MV3500Cohort2020JulySeptember/homework4/WeissenbergerGoericke/GermanyEspduVPNReceiver.java index 9da81fe9bcd97b46abf0d5ab5b4a4a126cc7b62d..e1dcc49eea24a0812113ede7da3e9dca9b5aa57d 100755 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework4/WeissenbergerGoericke/GermanyEspduVPNReceiver.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework4/WeissenbergerGoericke/GermanyEspduVPNReceiver.java @@ -10,7 +10,7 @@ import edu.nps.moves.dis7.utilities.*; /** * Receives PDUs from GermanyEspduReceiverEspduVPNSender in IEEE DIS format. * - * @date 09/05/2020 + * @version 09/05/2020 * @author Bernd/Stefan * @version 0.1 */ diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework4/White/test/PDUReciever.java b/assignments/src/MV3500Cohort2020JulySeptember/homework4/White/test/PDUReciever.java index 7e586acc7965d1b4f1fa37a0982425a8c7a6d22a..cb0b4929c443ff7614054a9f290669805a36c0c8 100755 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework4/White/test/PDUReciever.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework4/White/test/PDUReciever.java @@ -1,144 +1,144 @@ -package MV3500Cohort2020JulySeptember.homework4.White.test; - -import MV3500Cohort2020JulySeptember.homework4.White.working.*; -import java.io.*; -import java.net.*; -import java.util.*; - -import edu.nps.moves.dis7.pdus.*; -import edu.nps.moves.dis7.utilities.*; - -/** - * Receives PDUs from GermanyEspduReceiverEspduVPNSender in IEEE DIS format. - * - * @date 09/05/2020 - * @author Bernd/Stefan - * @version 0.1 - */ -public class PDUReciever { - - /** - * Max size of a PDU in binary format that we can receive. This is actually - * somewhat outdated--PDUs can be larger--but this is a reasonable starting - * point. - */ - public static final int MAX_PDU_SIZE = 8192; - - /** - * Default port used, matches Wireshark DIS capture default - */ - public static final int DEFAULT_PORT = 2317; - public static final int SECOND_PORT = 3000; - public static final int THIRD_PORT = 2318; - - - /** - * Output prefix to identify this class - */ - private final static String TRACE_PREFIX = "[" + PDUReciever.class.getName() + "] "; - - public static void main(String args[]) { - System.out.println(TRACE_PREFIX + "started..."); - - MulticastSocket socket1; - MulticastSocket socket2; - MulticastSocket socket3; - DatagramPacket packet; - DatagramPacket packet2; - DatagramPacket packet3; - PduFactory pduFactory = new PduFactory(); - ArrayList<EntityID> knownEntities = new ArrayList<EntityID>(); - int pduCount = 0; - - try { - // Specify the socket to receive data - socket1 = new MulticastSocket(DEFAULT_PORT); - socket2 = new MulticastSocket(SECOND_PORT); - socket3 = new MulticastSocket(THIRD_PORT); - - System.out.println(TRACE_PREFIX + "listening for PDU packets on port " + DEFAULT_PORT );//+ " " + SECOND_PORT + " " + THIRD_PORT); - System.out.println("===================================================="); - - while (true) // Loop infinitely, receiving datagrams - { - byte buffer[] = new byte[MAX_PDU_SIZE]; - packet = new DatagramPacket(buffer, buffer.length); - - socket1.receive(packet); - - - - List<Pdu> pduBundle = pduFactory.getPdusFromBundle(packet.getData(), packet.getLength()); - if (pduBundle.size() > 1) { // should be 1 for this project - System.out.println("Bundle size is " + pduBundle.size()); - } - - // end iterator loop through PDU bundle - for (Pdu aPdu : pduBundle) { - pduCount++; - String receiptMessage = String.format("%3s", pduCount) // right justify, 3 characters - + ". received PDU type " + aPdu.getPduType().getValue() + "=" + aPdu.getPduType().name() + " " + aPdu.getClass().getName() + " from " + packet.getAddress(); - if (aPdu instanceof EntityStatePdu) { - System.out.println(receiptMessage); - EntityID entityID = ((EntityStatePdu) aPdu).getEntityID(); - Vector3Double position = ((EntityStatePdu) aPdu).getEntityLocation(); - System.out.println(" entityID triplet: [" + entityID.getSiteID() + ", " + entityID.getApplicationID() + ", " + entityID.getEntityID() + "] "); - if (!knownEntities.contains(entityID)){ - knownEntities.add(entityID); - EntityType entityType = ((EntityStatePdu) aPdu).getEntityType(); - System.out.println(" New Entity: " +entityType.getEntityKind() + " "+ entityType.getDomain() + " "+ entityType.getCountry() + " "+ entityType.getCategory() + " "+ entityType.getSubCategory() + " "+ entityType.getSpecific() ); - } - System.out.println(" Location in DIS coordinates: [" + position.getX() + ", " + position.getY() + ", " + position.getZ() + "]"); - - } - else if (aPdu instanceof FirePdu){ - System.out.println(receiptMessage); - EntityID firingEntityID = ((FirePdu) aPdu).getFiringEntityID(); - EntityID targetEntityID = ((FirePdu) aPdu).getTargetEntityID(); - MunitionDescriptor munitionDescriptor = ((FirePdu) aPdu).getDescriptor(); - System.out.println(" firingEntityID triplet: [" + firingEntityID.getSiteID() + ", " + firingEntityID.getApplicationID() + ", " + firingEntityID.getEntityID() + "] "); - System.out.println(" targetEntityID triplet: [" + targetEntityID.getSiteID() + ", " + targetEntityID.getApplicationID() + ", " + targetEntityID.getEntityID() + "] "); - System.out.println(" Munition Information: [" + munitionDescriptor.getMunitionType().getDomain() + "."+munitionDescriptor.getMunitionType().getCountry() + "." + munitionDescriptor.getMunitionType().getCategory() + "."+ munitionDescriptor.getMunitionType().getSubCategory() + "." + munitionDescriptor.getMunitionType().getSpecific() + "]"); - } - else if (aPdu instanceof CommentReliablePdu){ - System.out.println(receiptMessage); - ArrayList<VariableDatum> payloadList = (ArrayList)((CommentReliablePdu) aPdu).getVariableDatumRecords(); - if (!payloadList.isEmpty()) - System.out.print (" messages: "); - for (VariableDatum variableDatum : payloadList) - { - String nextComment = new String(variableDatum.getVariableDatumValue()); // convert byte[] to String - System.out.print (" \"" + nextComment + "\""); - System.out.println(); - }// - } - else if (aPdu instanceof ResupplyOfferPdu){ - System.out.println(receiptMessage); - EntityID receiverID = ((ResupplyOfferPdu) aPdu).getReceivingEntityID(); - EntityID supplierID = ((ResupplyOfferPdu) aPdu).getSupplyingEntityID(); - List<SupplyQuantity> supplyList = ((ResupplyOfferPdu) aPdu).getSupplies(); - System.out.println(" Resupply Offer from Entity [" + supplierID.getSiteID() + ", "+ supplierID.getApplicationID() + ", " + supplierID.getEntityID() + "] to resupply Entity ["+ receiverID.getSiteID() + ", "+ receiverID.getApplicationID() + ", " + receiverID.getEntityID() + "]" ); - for (int i = 0; i < supplyList.size(); i++){ - SupplyQuantity supplyQ = supplyList.get(i); - EntityType entityType = supplyQ.getSupplyType(); - float supplyQuantity = supplyQ.getQuantity(); - System.out.println(" Supplies Offered: [Quantity: " + supplyQuantity + ", Type: " +entityType.getEntityKind() + " "+ entityType.getDomain() + " "+ entityType.getCountry() + " "+ entityType.getCategory() + " "+ entityType.getSubCategory() + " "+ entityType.getSpecific() + " ]"); - - } - } - - //OTHER PDU TYPES - else { - System.out.println(receiptMessage); - } - } // end of bundle loop - - } // end of while loop - } // end try block // end try block // end try block // end try block - catch (IOException ioe) { - System.out.println(TRACE_PREFIX + "Problem with input/output, see exception trace:"); - System.out.println(ioe); - } - System.out.println(TRACE_PREFIX + "complete."); - } // end main -} // end class +package MV3500Cohort2020JulySeptember.homework4.White.test; + +import MV3500Cohort2020JulySeptember.homework4.White.working.*; +import java.io.*; +import java.net.*; +import java.util.*; + +import edu.nps.moves.dis7.pdus.*; +import edu.nps.moves.dis7.utilities.*; + +/** + * Receives PDUs from GermanyEspduReceiverEspduVPNSender in IEEE DIS format. + * + * @version 09/05/2020 + * @author Bernd/Stefan + * @version 0.1 + */ +public class PDUReciever { + + /** + * Max size of a PDU in binary format that we can receive. This is actually + * somewhat outdated--PDUs can be larger--but this is a reasonable starting + * point. + */ + public static final int MAX_PDU_SIZE = 8192; + + /** + * Default port used, matches Wireshark DIS capture default + */ + public static final int DEFAULT_PORT = 2317; + public static final int SECOND_PORT = 3000; + public static final int THIRD_PORT = 2318; + + + /** + * Output prefix to identify this class + */ + private final static String TRACE_PREFIX = "[" + PDUReciever.class.getName() + "] "; + + public static void main(String args[]) { + System.out.println(TRACE_PREFIX + "started..."); + + MulticastSocket socket1; + MulticastSocket socket2; + MulticastSocket socket3; + DatagramPacket packet; + DatagramPacket packet2; + DatagramPacket packet3; + PduFactory pduFactory = new PduFactory(); + ArrayList<EntityID> knownEntities = new ArrayList<EntityID>(); + int pduCount = 0; + + try { + // Specify the socket to receive data + socket1 = new MulticastSocket(DEFAULT_PORT); + socket2 = new MulticastSocket(SECOND_PORT); + socket3 = new MulticastSocket(THIRD_PORT); + + System.out.println(TRACE_PREFIX + "listening for PDU packets on port " + DEFAULT_PORT );//+ " " + SECOND_PORT + " " + THIRD_PORT); + System.out.println("===================================================="); + + while (true) // Loop infinitely, receiving datagrams + { + byte buffer[] = new byte[MAX_PDU_SIZE]; + packet = new DatagramPacket(buffer, buffer.length); + + socket1.receive(packet); + + + + List<Pdu> pduBundle = pduFactory.getPdusFromBundle(packet.getData(), packet.getLength()); + if (pduBundle.size() > 1) { // should be 1 for this project + System.out.println("Bundle size is " + pduBundle.size()); + } + + // end iterator loop through PDU bundle + for (Pdu aPdu : pduBundle) { + pduCount++; + String receiptMessage = String.format("%3s", pduCount) // right justify, 3 characters + + ". received PDU type " + aPdu.getPduType().getValue() + "=" + aPdu.getPduType().name() + " " + aPdu.getClass().getName() + " from " + packet.getAddress(); + if (aPdu instanceof EntityStatePdu) { + System.out.println(receiptMessage); + EntityID entityID = ((EntityStatePdu) aPdu).getEntityID(); + Vector3Double position = ((EntityStatePdu) aPdu).getEntityLocation(); + System.out.println(" entityID triplet: [" + entityID.getSiteID() + ", " + entityID.getApplicationID() + ", " + entityID.getEntityID() + "] "); + if (!knownEntities.contains(entityID)){ + knownEntities.add(entityID); + EntityType entityType = ((EntityStatePdu) aPdu).getEntityType(); + System.out.println(" New Entity: " +entityType.getEntityKind() + " "+ entityType.getDomain() + " "+ entityType.getCountry() + " "+ entityType.getCategory() + " "+ entityType.getSubCategory() + " "+ entityType.getSpecific() ); + } + System.out.println(" Location in DIS coordinates: [" + position.getX() + ", " + position.getY() + ", " + position.getZ() + "]"); + + } + else if (aPdu instanceof FirePdu){ + System.out.println(receiptMessage); + EntityID firingEntityID = ((FirePdu) aPdu).getFiringEntityID(); + EntityID targetEntityID = ((FirePdu) aPdu).getTargetEntityID(); + MunitionDescriptor munitionDescriptor = ((FirePdu) aPdu).getDescriptor(); + System.out.println(" firingEntityID triplet: [" + firingEntityID.getSiteID() + ", " + firingEntityID.getApplicationID() + ", " + firingEntityID.getEntityID() + "] "); + System.out.println(" targetEntityID triplet: [" + targetEntityID.getSiteID() + ", " + targetEntityID.getApplicationID() + ", " + targetEntityID.getEntityID() + "] "); + System.out.println(" Munition Information: [" + munitionDescriptor.getMunitionType().getDomain() + "."+munitionDescriptor.getMunitionType().getCountry() + "." + munitionDescriptor.getMunitionType().getCategory() + "."+ munitionDescriptor.getMunitionType().getSubCategory() + "." + munitionDescriptor.getMunitionType().getSpecific() + "]"); + } + else if (aPdu instanceof CommentReliablePdu){ + System.out.println(receiptMessage); + ArrayList<VariableDatum> payloadList = (ArrayList)((CommentReliablePdu) aPdu).getVariableDatumRecords(); + if (!payloadList.isEmpty()) + System.out.print (" messages: "); + for (VariableDatum variableDatum : payloadList) + { + String nextComment = new String(variableDatum.getVariableDatumValue()); // convert byte[] to String + System.out.print (" \"" + nextComment + "\""); + System.out.println(); + }// + } + else if (aPdu instanceof ResupplyOfferPdu){ + System.out.println(receiptMessage); + EntityID receiverID = ((ResupplyOfferPdu) aPdu).getReceivingEntityID(); + EntityID supplierID = ((ResupplyOfferPdu) aPdu).getSupplyingEntityID(); + List<SupplyQuantity> supplyList = ((ResupplyOfferPdu) aPdu).getSupplies(); + System.out.println(" Resupply Offer from Entity [" + supplierID.getSiteID() + ", "+ supplierID.getApplicationID() + ", " + supplierID.getEntityID() + "] to resupply Entity ["+ receiverID.getSiteID() + ", "+ receiverID.getApplicationID() + ", " + receiverID.getEntityID() + "]" ); + for (int i = 0; i < supplyList.size(); i++){ + SupplyQuantity supplyQ = supplyList.get(i); + EntityType entityType = supplyQ.getSupplyType(); + float supplyQuantity = supplyQ.getQuantity(); + System.out.println(" Supplies Offered: [Quantity: " + supplyQuantity + ", Type: " +entityType.getEntityKind() + " "+ entityType.getDomain() + " "+ entityType.getCountry() + " "+ entityType.getCategory() + " "+ entityType.getSubCategory() + " "+ entityType.getSpecific() + " ]"); + + } + } + + //OTHER PDU TYPES + else { + System.out.println(receiptMessage); + } + } // end of bundle loop + + } // end of while loop + } // end try block // end try block // end try block // end try block + catch (IOException ioe) { + System.out.println(TRACE_PREFIX + "Problem with input/output, see exception trace:"); + System.out.println(ioe); + } + System.out.println(TRACE_PREFIX + "complete."); + } // end main +} // end class diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework4/White/working/PDUReciever.java b/assignments/src/MV3500Cohort2020JulySeptember/homework4/White/working/PDUReciever.java index 2c57207923d4cfd8734ae0673de147f6b807ae91..6fc95b2d962d099426a26b2065a3ff57cb5888b4 100755 --- a/assignments/src/MV3500Cohort2020JulySeptember/homework4/White/working/PDUReciever.java +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework4/White/working/PDUReciever.java @@ -10,7 +10,7 @@ import edu.nps.moves.dis7.utilities.*; /** * Receives PDUs from GermanyEspduReceiverEspduVPNSender in IEEE DIS format. * - * @date 09/05/2020 + * @version 09/05/2020 * @author Bernd/Stefan * @version 0.1 */ diff --git a/examples/DisDemo/src/disdemo/DisDemo.java b/examples/DisDemo/src/disdemo/DisDemo.java index 52ca24b82ae358e41070cb906cb067b7421bbcad..43354fac62edb7d1b2156b90114d19ace2245940 100644 --- a/examples/DisDemo/src/disdemo/DisDemo.java +++ b/examples/DisDemo/src/disdemo/DisDemo.java @@ -22,8 +22,9 @@ import java.util.*; public class DisDemo { /** - * @param args the command line arguments - * @throws java.lang.Exception + * Program invocation, execution starts here + * @param args command-line arguments + * @throws java.lang.Exception execution error */ public static void main(String[] args) throws Exception { diff --git a/examples/DisDemo/src/disdemo/EntityMoverSquare.java b/examples/DisDemo/src/disdemo/EntityMoverSquare.java index 821fe04e1ba9710409d702d497eed1a28c940bd5..e5397dcf0870137009d56cc540391e31baec3170 100644 --- a/examples/DisDemo/src/disdemo/EntityMoverSquare.java +++ b/examples/DisDemo/src/disdemo/EntityMoverSquare.java @@ -11,9 +11,9 @@ import edu.nps.moves.dis7.pdus.*; public class EntityMoverSquare extends EntityMover { /** How much an entity moves every quanta */ - public static final int STEP_SIZE = 1; + private static final int STEP_SIZE = 1; /** How big the square we move around is */ - public static final int SQUARE_SIZE = 50; // size of a side to the square, in meters + private static final int SQUARE_SIZE = 50; // size of a side to the square, in meters /** Directions we can travel. */ public enum Direction{NORTH, EAST, SOUTH, WEST}; diff --git a/examples/DisShooting/src/mv4503/NetworkComms.java b/examples/DisShooting/src/mv4503/NetworkComms.java index 8e0ddc81baf83ba6c530859dc9b741bcd321f7b4..b90bc92c1e8074164a2998f137f3bc81a2f87bf5 100644 --- a/examples/DisShooting/src/mv4503/NetworkComms.java +++ b/examples/DisShooting/src/mv4503/NetworkComms.java @@ -19,7 +19,7 @@ import java.util.logging.Logger; */ public class NetworkComms implements Runnable { - public static final int PORT = 3000; + private static final int PORT = 3000; private static NetworkComms networkComms = null; private DatagramSocket socket; diff --git a/examples/DisShooting/src/mv4503/SimulationRunner.java b/examples/DisShooting/src/mv4503/SimulationRunner.java index d45bdac6b6839fe84add337baf9162c72869e4f9..e849c59ad41047b67f8c9f8ad051f92ac4b108ba 100644 --- a/examples/DisShooting/src/mv4503/SimulationRunner.java +++ b/examples/DisShooting/src/mv4503/SimulationRunner.java @@ -23,11 +23,12 @@ public class SimulationRunner private Sniper sniper; private Target target; - + /** - * @param args the command line arguments + * Program invocation, execution starts here + * @param args command-line arguments */ - public static void main(String[] args) + public static void main(String[] args) { SimulationRunner runner = new SimulationRunner(); diff --git a/examples/WebsocketGateway/logs/jetty-2021_07_01.request.log b/examples/WebsocketGateway/logs/jetty-2021_07_01.request.log new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/examples/WebsocketGateway/src/edu/nps/moves/gateway/DisNative.java b/examples/WebsocketGateway/src/edu/nps/moves/gateway/DisNative.java index c8899e6762d5d2f5570033381ad8870e74789d36..68524a5343faf43b9992bc389988c8107807d410 100644 --- a/examples/WebsocketGateway/src/edu/nps/moves/gateway/DisNative.java +++ b/examples/WebsocketGateway/src/edu/nps/moves/gateway/DisNative.java @@ -21,7 +21,7 @@ import java.util.logging.Logger; */ public class DisNative implements Runnable, DISEndpoint { - public static final int PORT = 3000; + private static final int PORT = 3000; /** * Max size of UDP DIS packets to receive. May need to be bigger for bundled diff --git a/examples/WebsocketGateway/src/edu/nps/moves/gateway/WebSocketServer.java b/examples/WebsocketGateway/src/edu/nps/moves/gateway/WebSocketServer.java index 18692ab4e6e7253011466f0125ec2f20179715c5..3a9dccc9182d5ff010281aa1741bf8135cd214b4 100644 --- a/examples/WebsocketGateway/src/edu/nps/moves/gateway/WebSocketServer.java +++ b/examples/WebsocketGateway/src/edu/nps/moves/gateway/WebSocketServer.java @@ -32,7 +32,7 @@ import java.util.logging.Logger; public class WebSocketServer { /** The default port the webserver listens on. */ - public static final int DEFAULT_WEBSERVER_PORT = 8282; + private static final int DEFAULT_WEBSERVER_PORT = 8282; /** The web server we're creating */ private Server server; diff --git a/examples/src/HttpServletExamples/HttpWebPageSource.java b/examples/src/HttpServletExamples/HttpWebPageSource.java index 97166ba5a0593ae53b1276d4e4377f454281d2cc..6ca65b90997f699e5f661d88cdb8cdd326bec36c 100644 --- a/examples/src/HttpServletExamples/HttpWebPageSource.java +++ b/examples/src/HttpServletExamples/HttpWebPageSource.java @@ -13,9 +13,10 @@ import java.net.*; public class HttpWebPageSource { /** - * @param args the command line arguments + * Program invocation, execution starts here + * @param args command-line arguments */ - public static void main(String[] args) + public static void main(String[] args) { try { diff --git a/examples/src/OpenDis4Examples/EspduReceiver.java b/examples/src/OpenDis4Examples/EspduReceiver.java index d34a6d60bbad03fba7e9a7b4db4755547014d3fb..4f9be5581246fbffcc3d0f3bd018d6822fdc693d 100644 --- a/examples/src/OpenDis4Examples/EspduReceiver.java +++ b/examples/src/OpenDis4Examples/EspduReceiver.java @@ -20,14 +20,18 @@ public class EspduReceiver /** Max size of a PDU in binary format that we can receive. This is actually * somewhat outdated--PDUs can be larger--but this is a reasonable starting point. */ - public static final int MAX_PDU_SIZE = 8192; + private static final int MAX_PDU_SIZE = 8192; /** Default multicast group address we send on. */ - public static final String DEFAULT_MULTICAST_ADDRESS = "239.1.2.3"; + private static final String DEFAULT_MULTICAST_ADDRESS = "239.1.2.3"; /** Default multicast port used, matches Wireshark DIS capture default */ - public static final int DEFAULT_MULTICAST_PORT = 3000; + private static final int DEFAULT_MULTICAST_PORT = 3000; + /** + * Program invocation, execution starts here + * @param args command-line arguments + */ public static void main(String args[]) { System.out.println("OpenDis4Examples.EspduReceiver started..."); diff --git a/examples/src/OpenDis4Examples/EspduSender.java b/examples/src/OpenDis4Examples/EspduSender.java index dd0c8eeec4164f60ca5a2b83998ab411d5a6a22b..c4a472c130c0cd0b3759507e69804d817b48d064 100644 --- a/examples/src/OpenDis4Examples/EspduSender.java +++ b/examples/src/OpenDis4Examples/EspduSender.java @@ -41,7 +41,7 @@ public class EspduSender { * a join() will be done on the multicast address. port: port used for both * source and destination. * - * @param args + * @param args command-line arguments */ public static void main(String args[]) { diff --git a/examples/src/OpenDis4Examples/PduReceiver.java b/examples/src/OpenDis4Examples/PduReceiver.java index ab7161154619af3dc3588d28659188cc4a8bd71a..1014866879ac8ac34302f9d336d6beb0fbd05468 100644 --- a/examples/src/OpenDis4Examples/PduReceiver.java +++ b/examples/src/OpenDis4Examples/PduReceiver.java @@ -10,10 +10,14 @@ import java.io.IOException; public class PduReceiver { - public static final int MULTICAST_PORT = 3000; - public static final String MULTICAST_GROUP = "239.1.2.3"; - public static final boolean USE_FAST_ESPDU = false; + private static final int MULTICAST_PORT = 3000; + private static final String MULTICAST_GROUP = "239.1.2.3"; + private static final boolean USE_FAST_ESPDU = false; + /** + * Program invocation, execution starts here + * @param args command-line arguments + */ public static void main(String args[]) { PduFactory factory; diff --git a/examples/src/OpenDis4Examples/PduSender.java b/examples/src/OpenDis4Examples/PduSender.java index 6767f24044f4ead5bffcaf01217c126c23b1f321..f8be22550487343b808a08eb102945c2721f95a9 100644 --- a/examples/src/OpenDis4Examples/PduSender.java +++ b/examples/src/OpenDis4Examples/PduSender.java @@ -19,10 +19,10 @@ import edu.nps.moves.examples.ClassNameComparator; public class PduSender { /** Default multicast group address we send on. */ - public static final String DEFAULT_MULTICAST_ADDRESS = "239.1.2.3"; + private static final String DEFAULT_MULTICAST_ADDRESS = "239.1.2.3"; /** Default multicast port used, matches Wireshark DIS capture default */ - public static final int DEFAULT_MULTICAST_PORT = 3000; + private static final int DEFAULT_MULTICAST_PORT = 3000; private int port; InetAddress multicastAddress; @@ -182,6 +182,10 @@ public class PduSender } } + /** + * Program invocation, execution starts here + * @param args command-line arguments + */ public static void main(String args[]) { if (args.length == 2) { diff --git a/examples/src/OpenDis7Examples/AllPduReceiver.java b/examples/src/OpenDis7Examples/AllPduReceiver.java index fca670c79803bdb31e81bcdf6569dd3b4f93e135..e1a4b39af41b136be84680ab905b1cf219709cb3 100644 --- a/examples/src/OpenDis7Examples/AllPduReceiver.java +++ b/examples/src/OpenDis7Examples/AllPduReceiver.java @@ -14,7 +14,11 @@ public class AllPduReceiver public static final int DEFAULT_MULTICAST_PORT = AllPduSender.DEFAULT_MULTICAST_PORT; public static final boolean USE_FAST_ESPDU = false; - public static void main(String args[]) + /** + * Program invocation, execution starts here + * @param args command-line arguments + */ + public static void main(String args[]) { PduFactory factory; MulticastSocket socket; diff --git a/examples/src/OpenDis7Examples/AllPduSender.java b/examples/src/OpenDis7Examples/AllPduSender.java index 5bd043d2272534d3963858604167bf136fff4d13..47dd38024b60cb5e6b4c0eaebd7145cb81d58b1c 100755 --- a/examples/src/OpenDis7Examples/AllPduSender.java +++ b/examples/src/OpenDis7Examples/AllPduSender.java @@ -491,6 +491,10 @@ public class AllPduSender return generatedPdusList.size(); } + /** + * Program invocation, execution starts here + * @param args command-line arguments + */ public static void main(String args[]) { AllPduSender allPduSender; diff --git a/examples/src/OpenDis7Examples/EspduReceiver.java b/examples/src/OpenDis7Examples/EspduReceiver.java index 560adf8d65f28a8430f2023201033a6a7415a082..ec55541a94be1c6026b6315b35965a4fdab0b6e0 100755 --- a/examples/src/OpenDis7Examples/EspduReceiver.java +++ b/examples/src/OpenDis7Examples/EspduReceiver.java @@ -19,7 +19,7 @@ public class EspduReceiver /** Max size of a PDU in binary format that we can receive. This is actually * somewhat outdated--PDUs can be larger--but this is a reasonable starting point. */ - public static final int MAX_PDU_SIZE = 8192; + private static final int MAX_PDU_SIZE = 8192; /** Default multicast group address we send on. */ public static final String DEFAULT_MULTICAST_ADDRESS = EspduSender.DEFAULT_MULTICAST_ADDRESS; @@ -32,6 +32,10 @@ public class EspduReceiver */ private final static String TRACE_PREFIX = "[" + EspduReceiver.class.getName() + "] "; + /** + * Program invocation, execution starts here + * @param args command-line arguments + */ public static void main(String args[]) { System.out.println(TRACE_PREFIX + "started..."); diff --git a/examples/src/OpenDis7Examples/EspduSender.java b/examples/src/OpenDis7Examples/EspduSender.java index 28178a9d36f4bdf962a9da4f0a742cd465fbc635..ee0cc276cb42246dbc6a82a300010b6794db34a7 100644 --- a/examples/src/OpenDis7Examples/EspduSender.java +++ b/examples/src/OpenDis7Examples/EspduSender.java @@ -53,7 +53,7 @@ public class EspduSender * a join() will be done on the multicast address. port: port used for both * source and destination. * - * @param args + * @param args command-line arguments */ @SuppressWarnings("SleepWhileInLoop") // allows Thread.sleep(value) without warning in code public static void main(String args[]) diff --git a/examples/src/OpenDis7Examples/PduListenerSaver.java b/examples/src/OpenDis7Examples/PduListenerSaver.java index 769f82e140057da5c3b8d88ece6335a9c973e5eb..422bb6305493a416b2fcdc89b93b43f80aa70014 100644 --- a/examples/src/OpenDis7Examples/PduListenerSaver.java +++ b/examples/src/OpenDis7Examples/PduListenerSaver.java @@ -30,7 +30,11 @@ public class PduListenerSaver PAUSED; } - public static void main(String[] args) + /** + * Program invocation, execution starts here + * @param args command-line arguments + */ + public static void main(String[] args) { String outputDirectory = DEFAULT_OUTPUT_DIRECTORY; String multicastAddress = DEFAULT_MULTICAST_ADDRESS; diff --git a/examples/src/OpenDis7Examples/PduReaderPlayer.java b/examples/src/OpenDis7Examples/PduReaderPlayer.java index 9564e2fc8918f707eb7e500a559b7a4db02ec473..5707b732d08f82fa9853d7b87c24e83965b28b5e 100644 --- a/examples/src/OpenDis7Examples/PduReaderPlayer.java +++ b/examples/src/OpenDis7Examples/PduReaderPlayer.java @@ -31,7 +31,11 @@ public class PduReaderPlayer PAUSED; } - public static void main(String[] args) + /** + * Program invocation, execution starts here + * @param args command-line arguments + */ + public static void main(String[] args) { String outputDirectory = DEFAULT_OUTPUT_DIRECTORY; String multicastAddress = DEFAULT_MULTICAST_ADDRESS; diff --git a/examples/src/TcpExamples/TcpExample1Telnet.java b/examples/src/TcpExamples/TcpExample1Telnet.java index bf8bc8640fbd508c066f0362322632961fc71135..df9d5745c9f45f3bf975ce79df71db8c0d8fa9c3 100644 --- a/examples/src/TcpExamples/TcpExample1Telnet.java +++ b/examples/src/TcpExamples/TcpExample1Telnet.java @@ -32,7 +32,11 @@ import java.net.*; */ public class TcpExample1Telnet { - public static void main(String[] args) + /** + * Program invocation, execution starts here + * @param args command-line arguments + */ + public static void main(String[] args) { try { diff --git a/examples/src/TcpExamples/TcpExample2ConnectionCounting.java b/examples/src/TcpExamples/TcpExample2ConnectionCounting.java index e38b3aff63a80fc5e6f5288ac44831de4c75eeda..158c837d050f5a59f0c2a58e58d4e350e89f0194 100644 --- a/examples/src/TcpExamples/TcpExample2ConnectionCounting.java +++ b/examples/src/TcpExamples/TcpExample2ConnectionCounting.java @@ -23,7 +23,11 @@ import java.net.*; */ public class TcpExample2ConnectionCounting { - public static void main(String[] args) + /** + * Program invocation, execution starts here + * @param args command-line arguments + */ + public static void main(String[] args) { try { diff --git a/examples/src/TcpExamples/TcpExample3Client.java b/examples/src/TcpExamples/TcpExample3Client.java index cb346fa0833a42238dbbf1e723314ebbb7980126..48d46c3f2bfed71903c733b98583901dc7a8c2e9 100644 --- a/examples/src/TcpExamples/TcpExample3Client.java +++ b/examples/src/TcpExamples/TcpExample3Client.java @@ -19,6 +19,10 @@ public class TcpExample3Client { // IPv6 String constant for localhost address, similarly IPv4 127.0.0.1 public final static String LOCALHOST = "0:0:0:0:0:0:0:1"; + /** + * Program invocation, execution starts here + * @param args command-line arguments + */ public static void main(String[] args) { // Local variables/fields diff --git a/examples/src/TcpExamples/TcpExample3Server.java b/examples/src/TcpExamples/TcpExample3Server.java index 5741aa7eea5b96d4c1561252fa70189e72df44f3..6e90a6cffd742a3a60ba7b7cb2c8144150fe6b26 100644 --- a/examples/src/TcpExamples/TcpExample3Server.java +++ b/examples/src/TcpExamples/TcpExample3Server.java @@ -24,6 +24,10 @@ import java.net.*; */ public class TcpExample3Server { + /** + * Program invocation, execution starts here + * @param args command-line arguments + */ public static void main(String[] args) { try { diff --git a/examples/src/TcpExamples/TcpExample4Client.java b/examples/src/TcpExamples/TcpExample4Client.java index 87ba53107d0549a60af3a3784da45139a004f49d..464fd7be1323669a305427490783633bbfa6bb48 100644 --- a/examples/src/TcpExamples/TcpExample4Client.java +++ b/examples/src/TcpExamples/TcpExample4Client.java @@ -16,6 +16,10 @@ public class TcpExample4Client { static String DESTINATION_HOST = "localhost"; static int MAX_LOOP_COUNT = 4; + /** + * Program invocation, execution starts here + * @param args command-line arguments + */ public static void main(String[] args) { try { System.out.println("TcpExample4Client start, loop " + MAX_LOOP_COUNT + " times"); diff --git a/examples/src/TcpExamples/TcpExample4DispatchServer.java b/examples/src/TcpExamples/TcpExample4DispatchServer.java index 1c014b8758ee5dc82009e2725376b2dde3dc0e5c..705da361b13ef48cf70d54805766a776f176cc35 100644 --- a/examples/src/TcpExamples/TcpExample4DispatchServer.java +++ b/examples/src/TcpExamples/TcpExample4DispatchServer.java @@ -13,7 +13,11 @@ import java.net.*; */ public class TcpExample4DispatchServer { - public static void main(String[] args) // execution starts here + /** + * Program invocation, execution starts here + * @param args command-line arguments + */ + public static void main(String[] args) { try { ServerSocket serverSocket = new ServerSocket(2317); diff --git a/examples/src/UdpMulticastExamples/MulticastReceiver.java b/examples/src/UdpMulticastExamples/MulticastReceiver.java index 9c8716d99de7e3cb373803f502447850a8604cc0..6a55a5c050fd4e00d5c8764c054d655c2b07100e 100644 --- a/examples/src/UdpMulticastExamples/MulticastReceiver.java +++ b/examples/src/UdpMulticastExamples/MulticastReceiver.java @@ -18,19 +18,23 @@ public class MulticastReceiver { // reserved range for all IPv4 multicast: 224.0.0.0 through 239.255.255.255 // https://en.wikipedia.org/wiki/Multicast_address // https://www.iana.org/assignments/multicast-addresses/multicast-addresses.xhtml - public static final String MULTICAST_ADDRESS = "239.1.2.15"; - public static final int DESTINATION_PORT = 1718; + private static final String MULTICAST_ADDRESS = "239.1.2.15"; + private static final int DESTINATION_PORT = 1718; /** * Time to live: how many router-decrement levels can be crossed */ - public static final int TTL = 10; + private static final int TTL = 10; private static final boolean INFINITE_READ_LOOP = true; private static NetworkInterface ni; - public static void main(String[] args) { - + /** + * Program invocation, execution starts here + * @param args command-line arguments + */ + public static void main(String[] args) + { MulticastSocket multicastSocket = null; InetSocketAddress group = null; ByteBuffer buffer = ByteBuffer.allocate(1500); diff --git a/examples/src/UdpMulticastExamples/MulticastSender.java b/examples/src/UdpMulticastExamples/MulticastSender.java index b4021f019653f418edf6b2d891d0ed84848f6984..28820bebd8d9e2cb83334a2e24c9196638b9e25d 100644 --- a/examples/src/UdpMulticastExamples/MulticastSender.java +++ b/examples/src/UdpMulticastExamples/MulticastSender.java @@ -32,6 +32,11 @@ public class MulticastSender { public static final String QUIT_SENTINEL = "QUIT QUIT QUIT!"; private static NetworkInterface ni; + /** + * Program invocation, execution starts here + * @param args command-line arguments + * @throws java.io.IOException execution error + */ @SuppressWarnings("SleepWhileInLoop") public static void main(String[] args) throws IOException { diff --git a/examples/src/UdpMulticastExamples/UdpReceiver.java b/examples/src/UdpMulticastExamples/UdpReceiver.java index cd1dfea7540df9ea87f7f3c9cf227af586f59ea1..987493ecdd9ce1b68d24a8d455660f6c1501ccfc 100644 --- a/examples/src/UdpMulticastExamples/UdpReceiver.java +++ b/examples/src/UdpMulticastExamples/UdpReceiver.java @@ -10,22 +10,23 @@ import java.net.*; * * Start this before launching UdpSender. * - * @see https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html - * @see https://en.wikipedia.org/wiki/User_Datagram_Protocol + * @see <a href="https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html">https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html</a> + * @see <a href="https://en.wikipedia.org/wiki/User_Datagram_Protocol">https://en.wikipedia.org/wiki/User_Datagram_Protocol</a> * @author mcgredo * @author brutzman */ public class UdpReceiver { -// public static final int SENDING_PORT = 1414; // port used by UdpSender, unneeded here - public static final int RECEIVING_PORT = 1415; - public static final String DESINATION_HOST = "localhost"; +// private static final int SENDING_PORT = 1414; // port used by UdpSender, unneeded here + private static final int RECEIVING_PORT = 1415; + private static final String DESINATION_HOST = "localhost"; /** - * @param args the command line arguments - * @throws java.io.IOException + * Program invocation, execution starts here + * @param args command-line arguments + * @throws java.io.IOException execution error */ - public static void main(String[] args) throws IOException + public static void main(String[] args) throws IOException { DatagramSocket udpSocket = null; diff --git a/examples/src/UdpMulticastExamples/UdpSender.java b/examples/src/UdpMulticastExamples/UdpSender.java index 8a658e878bb7ec212e666fc5ebeeea6b51617312..e4e9bab1c2267379bc8e33f1cad7fed231894aa2 100644 --- a/examples/src/UdpMulticastExamples/UdpSender.java +++ b/examples/src/UdpMulticastExamples/UdpSender.java @@ -11,22 +11,27 @@ import java.net.*; * * Start this before launching UdpReceiver. * - * @see https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html - * @see https://en.wikipedia.org/wiki/User_Datagram_Protocol + * @see <a href="https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html">https://docs.oracle.com/javase/tutorial/essential/io/datastreams.html</a> + * @see <a href="https://en.wikipedia.org/wiki/User_Datagram_Protocol">https://en.wikipedia.org/wiki/User_Datagram_Protocol</a> + * @see <a href="https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html">System properties</a> * @author mcgredo * @author brutzman */ public class UdpSender { - // System properties: https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html - public static final String MY_NAME = System.getProperty("user.name"); // guru incantation 8) -// public static final int SENDING_PORT = 1414; // not needed, can let system choose an open local port - public static final int RECEIVING_PORT = 1415; - public static final int TOTAL_PACKETS_TO_SEND = 100; + private static final String MY_NAME = System.getProperty("user.name"); // guru incantation 8) +// private static final int SENDING_PORT = 1414; // not needed, can let system choose an open local port + private static final int RECEIVING_PORT = 1415; + private static final int TOTAL_PACKETS_TO_SEND = 100; // here is what we need for lab comms - public static final String DESTINATION_HOST = "10.1.105.16"; // localhost 127.0.0.1 or argon 10.1.105.1 or 10.1.105.1 or whatever + private static final String DESTINATION_HOST = "10.1.105.16"; // localhost 127.0.0.1 or argon 10.1.105.1 or 10.1.105.1 or whatever + /** + * Program invocation, execution starts here + * @param args command-line arguments + * @throws java.io.IOException execution error + */ @SuppressWarnings("SleepWhileInLoop") public static void main(String[] args) throws IOException {