diff --git a/assignments/nbproject/project.xml b/assignments/nbproject/project.xml index 042a5d4de46fba4c89134e0e68f7624366a0b5cb..a8deed1628f74f99861205f0c0c7df64c605b09b 100644 --- a/assignments/nbproject/project.xml +++ b/assignments/nbproject/project.xml @@ -1,27 +1,27 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://www.netbeans.org/ns/project/1"> - <type>org.netbeans.modules.java.j2seproject</type> - <configuration> - <data xmlns="http://www.netbeans.org/ns/j2se-project/3"> - <name>Networked Graphics MV3500 assignments</name> - <source-roots> - <root id="src.dir"/> - </source-roots> - <test-roots> - <root id="test.src.dir"/> - </test-roots> - </data> - <spellchecker-wordlist xmlns="http://www.netbeans.org/ns/spellchecker-wordlist/1"> - <word>deliverables</word> - <word>https</word> - <word>localhost</word> - <word>multicast</word> - <word>Netbeans</word> - <word>README</word> - <word>UML</word> - <word>unicast</word> - <word>wikipedia</word> - <word>Wireshark</word> - </spellchecker-wordlist> - </configuration> -</project> +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://www.netbeans.org/ns/project/1"> + <type>org.netbeans.modules.java.j2seproject</type> + <configuration> + <data xmlns="http://www.netbeans.org/ns/j2se-project/3"> + <name>Networked Graphics MV3500 assignments</name> + <source-roots> + <root id="src.dir"/> + </source-roots> + <test-roots> + <root id="test.src.dir"/> + </test-roots> + </data> + <spellchecker-wordlist xmlns="http://www.netbeans.org/ns/spellchecker-wordlist/1"> + <word>deliverables</word> + <word>https</word> + <word>localhost</word> + <word>multicast</word> + <word>Netbeans</word> + <word>README</word> + <word>UML</word> + <word>unicast</word> + <word>wikipedia</word> + <word>Wireshark</word> + </spellchecker-wordlist> + </configuration> +</project> diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework1/BrittTcPExample1Telnet.java b/assignments/src/MV3500Cohort2020JulySeptember/homework1/BrittTcPExample1Telnet.java new file mode 100644 index 0000000000000000000000000000000000000000..7278c7aee899ded4eb187eb4d07067e55d831d26 --- /dev/null +++ b/assignments/src/MV3500Cohort2020JulySeptember/homework1/BrittTcPExample1Telnet.java @@ -0,0 +1,62 @@ + +package MV3500Cohort2020JulySeptember.homework1; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintStream; +import java.net.ServerSocket; +import java.net.Socket; + + +/** + * + * @author Brittokki + */ +public class BrittTcPExample1Telnet { + /** When you run this program, the main method is invoked. + * @param args command-line arguments */ + public static void main(String[] args) + { + try + { + System.out.println("TcpExample1Telnet has started and is waiting for a connection."); + System.out.println(" help: https://savage.nps.edu/Savage/developers.html#telnet"); + System.out.println(" enter (telnet localhost 2317) or (nc localhost 2317)..." ); + + // The ServerSocket waits for a connection from a client. + // It returns a Socket object when the connection occurs. + ServerSocket serverSocket = new ServerSocket(2317); + + // Use Java io classes to write text (as opposed to + // unknown bytes of some sort) to the client + + // The Socket object represents the connection between + // the server and client, including a full duplex connection + try (Socket clientConnection = serverSocket.accept()) { + // Use Java io classes to write text (as opposed to + // unknown bytes of some sort) to the client + OutputStream os = clientConnection.getOutputStream(); + PrintStream ps = new PrintStream(os); + + ps.println("This client response was written by Captain Britt."); + System.out.println("This server response was written by Captain Britt."); + + // "flush()" in important in that it forces a write + // across what is in fact a slow connection + ps.flush(); + } + System.out.println("TcpExample1 completed successfully."); + } + catch(IOException e) + { + System.err.println("Problem with TcpExample1Telnet networking:"); // describe what is happening + System.err.println("Error: " + e); + // Provide more helpful information to user if exception occurs due to running twice at one time + + // brute force exception checking, can be brittle if exception message changes + // if (e.getMessage().equals("Address already in use: NET_Bind")) + if (e instanceof java.net.BindException) + System.err.println("*** Be sure to stop any other running instances of programs using this port!"); + } + } +} \ No newline at end of file diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework2/Weissenberger/HW2.jpg b/assignments/src/MV3500Cohort2020JulySeptember/homework2/Weissenberger/HW2.jpg deleted file mode 100644 index 2babdaed93845fd29dbe1e82b7c6f27d9cfe4ee3..0000000000000000000000000000000000000000 Binary files a/assignments/src/MV3500Cohort2020JulySeptember/homework2/Weissenberger/HW2.jpg and /dev/null differ diff --git a/assignments/src/MV3500Cohort2020JulySeptember/homework2/White/White2.pdf b/assignments/src/MV3500Cohort2020JulySeptember/homework2/White/White2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..595f225d06c669e7393cf972d8fa85bb4bcb7962 Binary files /dev/null and b/assignments/src/MV3500Cohort2020JulySeptember/homework2/White/White2.pdf differ diff --git a/examples/src/OpenDis7Examples/PduReaderPlayer.java b/examples/src/OpenDis7Examples/PduReaderPlayer.java index d47bd02719e01ff34fb9f21fcf3757f84fccb019..bdfc3c568c576e3bedaf95e4c9736be1044ab482 100644 --- a/examples/src/OpenDis7Examples/PduReaderPlayer.java +++ b/examples/src/OpenDis7Examples/PduReaderPlayer.java @@ -4,7 +4,6 @@ */ package OpenDis7Examples; -import edu.nps.moves.dis7.utilities.DisThreadedNetIF; import edu.nps.moves.dis7.utilities.stream.PduPlayer; import java.io.IOException; import java.nio.file.Path; @@ -37,6 +36,7 @@ public class PduReaderPlayer String outputDirectory = DEFAULT_OUTPUT_DIRECTORY; String multicastAddress = DEFAULT_MULTICAST_ADDRESS; int multicastPort = DEFAULT_MULTICAST_PORT; + boolean sendToNet = false; System.out.println("DisExamplesOpenDis7.PduReaderPlayer started..."); @@ -45,11 +45,13 @@ public class PduReaderPlayer break; case 1: outputDirectory = args[0]; + sendToNet = Boolean.valueOf(args[1]); break; case 3: outputDirectory = args[0]; multicastAddress = args[1]; multicastPort = Integer.parseInt(args[2]); + sendToNet = Boolean.valueOf(args[3]); break; default: System.err.println("Usage: PduReaderPlayer() or " @@ -60,8 +62,8 @@ public class PduReaderPlayer System.out.println("Beginning PduReaderPlayer (" + multicastAddress + ":" + multicastPort + ") to directory " + outputDirectory); try { - PduPlayer player = new PduPlayer(multicastAddress, multicastPort, new File(outputDirectory).toPath()); - player.startResume(); + PduPlayer pduPlayer = new PduPlayer(multicastAddress, multicastPort, Path.of(outputDirectory), sendToNet); + pduPlayer.startResume(); mystate state = mystate.RUNNING; Scanner scan = new Scanner(System.in); diff --git a/lib/open-dis7-java.jar b/lib/open-dis7-java.jar index d4fe5e1ddd225dc95d7449f6289edf7d1057c23f..638d31ec50395d2c1989181448740e172623e307 100644 Binary files a/lib/open-dis7-java.jar and b/lib/open-dis7-java.jar differ diff --git a/lib/open-dis7-javadoc.jar b/lib/open-dis7-javadoc.jar index f1113204e6476b241f8c445a4c0e145c41e20d06..13feb1093d169886bf4b75134debadf3ec838717 100644 Binary files a/lib/open-dis7-javadoc.jar and b/lib/open-dis7-javadoc.jar differ diff --git a/presentations/03_TCPIP.pptx b/presentations/03_TCPIP.pptx index a2065a6c122309d4371d30e174d37822c6a352c2..91cb16047cfd2e00036aec61e0571f01c26dd5ba 100644 Binary files a/presentations/03_TCPIP.pptx and b/presentations/03_TCPIP.pptx differ diff --git a/presentations/04_TCPSocketsJava.pptx b/presentations/04_TCPSocketsJava.pptx index 580d26aaeb1e2dc2b409b28e37484c8abbe45030..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 Binary files a/presentations/04_TCPSocketsJava.pptx and b/presentations/04_TCPSocketsJava.pptx differ diff --git a/presentations/06_UDP_UserDatagramProtocol.pptx b/presentations/06_UDP_UserDatagramProtocol.pptx index 7ed1193e78665add02af9d4a61a5f8e50e1f62d4..98d130f62bad21ead878a64992c9281f4014de93 100644 Binary files a/presentations/06_UDP_UserDatagramProtocol.pptx and b/presentations/06_UDP_UserDatagramProtocol.pptx differ