From 5b7bd33262ab693bf0e26e6c5dd6eea67bf79590 Mon Sep 17 00:00:00 2001
From: John Furr <John Furr@Johns_Asus>
Date: Tue, 31 Jul 2018 18:06:21 -0700
Subject: [PATCH] Created Homework2 Folder and added shells for assignment.

---
 .gitignore                                    |   4 +-
 .../homework2/Furr/FurrTcpClient.java         |  60 ++++++++++++++++++
 .../{ => Furr}/Furr_Made_Up_UML_Diagram.jpg   | Bin
 3 files changed, 63 insertions(+), 1 deletion(-)
 create mode 100644 deliverables/src/MV3500Cohort2018JulySeptember/homework2/Furr/FurrTcpClient.java
 rename deliverables/src/MV3500Cohort2018JulySeptember/homework2/{ => Furr}/Furr_Made_Up_UML_Diagram.jpg (100%)

diff --git a/.gitignore b/.gitignore
index 76e3b89d15..50dc8f7c8e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,4 +37,6 @@
 /projects/TcpExample3/Server/TcpServer/nbproject/private
 /deliverables/nbproject/private/
 /projects/Assignments/dist/
-/deliverables/build/
\ No newline at end of file
+/deliverables/build/
+/projects/TcpExample3/Client/TcpClient/build/
+/projects/TcpExample3/Server/TcpServer/build/
\ No newline at end of file
diff --git a/deliverables/src/MV3500Cohort2018JulySeptember/homework2/Furr/FurrTcpClient.java b/deliverables/src/MV3500Cohort2018JulySeptember/homework2/Furr/FurrTcpClient.java
new file mode 100644
index 0000000000..9655970545
--- /dev/null
+++ b/deliverables/src/MV3500Cohort2018JulySeptember/homework2/Furr/FurrTcpClient.java
@@ -0,0 +1,60 @@
+
+package MV3500Cohort2018JulySeptember.homework2.Furr;
+
+import java.io.*;
+import java.net.*;
+
+/**
+ * Before, we always used telnet to connect to the server.
+ * Here we are now writing our own program to do the connection.
+ * 
+ * As you will see, when we run this after we start the server
+ * we will see the same string telnet printed, sent by the server.
+ * The output at the server will show different socket pairs for
+ * each time we ran it.
+ * 
+ * @author mcgredo
+ */
+public class FurrTcpClient {
+
+	public final static String LOCALHOST = "0:0:0:0:0:0:0:1"; // String constant, i.e. 127.0.0.1
+  
+    public static void main(String[] args) 
+    {
+        try
+        {
+          while(true)
+          {
+           System.out.println("creating socket");
+           
+           // We request an IP to connect to ("localhost") and
+           // port number at that IP (2317). This establishes
+           // a connection to that IP in the form of the Socket
+           // object; the server uses a ServerSocket to wait for
+           // connections.
+           Socket socket = new Socket(LOCALHOST, 2317); // locohost?
+           
+           // Read the single line written by the server. We'd
+           // do things a bit differently if many lines to be read
+           // from the server, instead of one only.
+           InputStream is = socket.getInputStream();
+           InputStreamReader isr = new InputStreamReader(is);
+           BufferedReader br = new BufferedReader(isr);
+           
+           String serverMessage = br.readLine();
+           System.out.println("==================================================");
+           System.out.println("Now we're talking!");
+           System.out.println("The message the server sent was " + serverMessage);
+		   // socket gets closed, either automatically/silently this code (or possibly by server)
+		 } // end while(true)
+        }
+        catch(IOException e)
+        {
+            System.out.println("Problem with client: "); // describe what is happening
+            System.out.println(e);
+        }
+		// program exit: tell somebody about that
+		System.out.println("client exit");
+    }
+    
+}
diff --git a/deliverables/src/MV3500Cohort2018JulySeptember/homework2/Furr_Made_Up_UML_Diagram.jpg b/deliverables/src/MV3500Cohort2018JulySeptember/homework2/Furr/Furr_Made_Up_UML_Diagram.jpg
similarity index 100%
rename from deliverables/src/MV3500Cohort2018JulySeptember/homework2/Furr_Made_Up_UML_Diagram.jpg
rename to deliverables/src/MV3500Cohort2018JulySeptember/homework2/Furr/Furr_Made_Up_UML_Diagram.jpg
-- 
GitLab