diff --git a/deliverables/src/MV3500Cohort2018JulySeptember/homework1/FurrAssignment1.java b/deliverables/src/MV3500Cohort2018JulySeptember/homework1/FurrAssignment1.java new file mode 100644 index 0000000000000000000000000000000000000000..7a2772aa5c2e6340ef015a70dd9db29bc7111a58 --- /dev/null +++ b/deliverables/src/MV3500Cohort2018JulySeptember/homework1/FurrAssignment1.java @@ -0,0 +1,66 @@ +package MV3500Cohort2018JulySeptember.homework1; + +import java.io.*; +import java.net.*; + +/** + * The simplest possible TCP network program. It listens for + * a connection, from telnet (telnet localhost 2317) or a program + * you write, which we will do later. Right now the TcpExample simply + * writes a string in response to a connection. + * + * Testing the running server program from telnet looks like this: + * + * it154916:projects mcgredo$ telnet localhost 2317 + * Trying ::1... + * Connected to localhost. + * Escape character is '^]'. + * This was written by the server + * Connection closed by foreign host. + * + * Notice that "This was written by the server" matches + * what is written by the code below, over the output stream. + * + * After this first connection the program below drops out + * the bottom of the program, and does not repeat itself. + * The program exits. + * + * @author mcgredo + */ +public class FurrAssignment1 +{ + + public static void main(String[] args) + { + try + { + // The ServerSocket waits for a connection from a client. + // It returns a Socket object when the connection occurs. + ServerSocket serverSocket = new ServerSocket(2317); + + // The Socket object represents the connection between + // the server and client, including a full duplex + // connection + 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 server FurrAssignment1"); // to remote client + System.out.println("This server response was written by server FurrAssignment1"); // to server console + ps.println("Thanks for showing up it's been fun, but you have to go now. Goodbye!"); //added a goodbye message, it really has been fun! + + // "flush()" in important in that it forces a write + // across what is in fact a slow connection + ps.flush(); + + clientConnection.close(); + } + catch(Exception e) + { + System.out.println("problem with networking: " + e); + } + } +} diff --git a/deliverables/src/MV3500Cohort2018JulySeptember/homework1/FurrAssignment2.java b/deliverables/src/MV3500Cohort2018JulySeptember/homework1/FurrAssignment2.java index e7f6739d01197a2a85cefb41f62a5f7a71e77672..d11e2fb4706fd23c72c0f6e1d1108d709d6b7faf 100644 --- a/deliverables/src/MV3500Cohort2018JulySeptember/homework1/FurrAssignment2.java +++ b/deliverables/src/MV3500Cohort2018JulySeptember/homework1/FurrAssignment2.java @@ -1,3 +1,4 @@ + package MV3500Cohort2018JulySeptember.homework1; import java.io.*; diff --git a/deliverables/src/MV3500Cohort2018JulySeptember/homework1/FurrAssignment2Screenshots.pptx b/deliverables/src/MV3500Cohort2018JulySeptember/homework1/FurrAssignment2Screenshots.pptx new file mode 100644 index 0000000000000000000000000000000000000000..5ba10ebc661548eaa73318a0f7f687ea4434ace7 Binary files /dev/null and b/deliverables/src/MV3500Cohort2018JulySeptember/homework1/FurrAssignment2Screenshots.pptx differ diff --git a/deliverables/src/MV3500Cohort2018JulySeptember/homework1/FurrAssignment2_UMLSequence_Diagram.jpg b/deliverables/src/MV3500Cohort2018JulySeptember/homework1/FurrAssignment2_UMLSequence_Diagram.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5785d1608affcd061ba250b6b5f08544fb8cba3d Binary files /dev/null and b/deliverables/src/MV3500Cohort2018JulySeptember/homework1/FurrAssignment2_UMLSequence_Diagram.jpg differ diff --git a/projects/Assignments/2018JulySeptember/homework1/FurrAssignment2.java b/projects/Assignments/2018JulySeptember/homework1/FurrAssignment2.java deleted file mode 100644 index e7d8f9b7902eab69ec6c6450fd302bae99828b73..0000000000000000000000000000000000000000 --- a/projects/Assignments/2018JulySeptember/homework1/FurrAssignment2.java +++ /dev/null @@ -1,93 +0,0 @@ - -package FurrAssignment2; - -import java.io.*; -import java.net.*; - -/** - * Very slightly more complex than example1. The only thing this does - * differently is introduce a loop into the response, so you don't - * have to restart the program after one response. Also, it prints - * out the socket pair the server sees. Run the program via telnet - * several times and 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 - * - * And have him display the socket pairs he got. - * @author mcgredo - */ -public class FurrAssignment2 -{ - - public static void main(String[] args) - { - try - { - // ServerSocket waits for a connection from a client. - // Notice that it is outside the loop; ServerSocket - // needs to be made only once. - - int connectionCount = 0; // state - for(int i=2317; i<10; i++){ - ServerSocket serverSocket = new ServerSocket(i); - System.out.println("server established for port #" +i); - } - - // Loop, infinitely, waiting for client connections. - // Stop the program somewhere else. - while(true) - { - Socket clientConnection = serverSocket.accept(); // blocks! then proceeds once a connection is "accept"ed - - connectionCount++; // got another one! - - OutputStream os = clientConnection.getOutputStream(); - PrintStream ps = new PrintStream(os); - - ps.println("This client response was written by server TcpExample2"); // to remote client - System.out.println("This server response was written by server TcpExample2"); // to server console - - // Print some information locally about the Socket - // connection. This includes the port and IP numbers - // on both sides (the socket pair.) - - InetAddress localAddress = clientConnection.getLocalAddress(); - InetAddress remoteAddress = clientConnection.getInetAddress(); - - int localPort = clientConnection.getLocalPort(); - int remotePort = clientConnection.getPort(); - - // My socket pair connection looks like this, to localhost: - // Socket pair: (( /0:0:0:0:0:0:0:1, 2317 ), ( /0:0:0:0:0:0:0:1, 54876 )) - // Socket pair: (( /0:0:0:0:0:0:0:1, 2317 ), ( /0:0:0:0:0:0:0:1, 54881 )) - // - // Why is the first IP/port the same, while the second set has - // different ports? - - - System.out.println("Socket pair: (( " + localAddress.toString() + ", " + localPort + " ), ( " + - remoteAddress.toString() + ", " + remotePort + " ))"); - - System.out.println("got another connection, #" + connectionCount); // report progress - - // Notice the use of flush() and close(). Without - // the close() to Socket object may stay open for - // a while after the client has stopped needing this - // connection. Close() explicitly ends the connection. - ps.flush(); - clientConnection.close(); - } - } - catch(Exception e) - { - System.out.println("problem with networking: " + e); - } - - } - -} diff --git a/projects/Assignments/2018JulySeptember/homework2/Furr_Made_Up_UML_Diagram.jpg b/projects/Assignments/2018JulySeptember/homework2/Furr_Made_Up_UML_Diagram.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f877235ba88e2724d7332a437991426bb09620c4 Binary files /dev/null and b/projects/Assignments/2018JulySeptember/homework2/Furr_Made_Up_UML_Diagram.jpg differ diff --git a/projects/Assignments/dist/Assignments__MV3500_Homework.jar b/projects/Assignments/dist/Assignments__MV3500_Homework.jar new file mode 100644 index 0000000000000000000000000000000000000000..7c21ab0d6d1ea70e76f5d0864f747eb9ab7ff0a7 Binary files /dev/null and b/projects/Assignments/dist/Assignments__MV3500_Homework.jar differ diff --git a/projects/Assignments/dist/README.TXT b/projects/Assignments/dist/README.TXT new file mode 100644 index 0000000000000000000000000000000000000000..506c1d5dc26f788713c72fb1411639aba809c250 --- /dev/null +++ b/projects/Assignments/dist/README.TXT @@ -0,0 +1,32 @@ +======================== +BUILD OUTPUT DESCRIPTION +======================== + +When you build an Java application project that has a main class, the IDE +automatically copies all of the JAR +files on the projects classpath to your projects dist/lib folder. The IDE +also adds each of the JAR files to the Class-Path element in the application +JAR files manifest file (MANIFEST.MF). + +To run the project from the command line, go to the dist folder and +type the following: + +java -jar "Assignments__MV3500_Homework.jar" + +To distribute this project, zip up the dist folder (including the lib folder) +and distribute the ZIP file. + +Notes: + +* If two JAR files on the project classpath have the same name, only the first +JAR file is copied to the lib folder. +* Only JAR files are copied to the lib folder. +If the classpath contains other types of files or folders, these files (folders) +are not copied. +* If a library on the projects classpath also has a Class-Path element +specified in the manifest,the content of the Class-Path element has to be on +the projects runtime path. +* To set a main class in a standard Java project, right-click the project node +in the Projects window and choose Properties. Then click Run and enter the +class name in the Main Class field. Alternatively, you can manually type the +class name in the manifest Main-Class element. diff --git a/projects/Assignments/dist/lib/dis-enums_1.1.jar b/projects/Assignments/dist/lib/dis-enums_1.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..5b6114887306ef19ac76559e3e7a4eb874b2637a Binary files /dev/null and b/projects/Assignments/dist/lib/dis-enums_1.1.jar differ diff --git a/projects/Assignments/dist/lib/open-dis_4.16.jar b/projects/Assignments/dist/lib/open-dis_4.16.jar new file mode 100644 index 0000000000000000000000000000000000000000..3a956c989b1511334d36ad498375d552c758295c Binary files /dev/null and b/projects/Assignments/dist/lib/open-dis_4.16.jar differ