From b4d196e21eb1e13614f83bfe2d968abc3a595d79 Mon Sep 17 00:00:00 2001 From: justi <justi@LAPTOP-258UDA82> Date: Thu, 19 Aug 2021 15:30:35 -0700 Subject: [PATCH] Frank Assignment 2 --- .../homework2/Frank/FrankClient.java | 9 ++++++-- .../homework2/Frank/FrankServer.java | 21 +++++++++++-------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/assignments/src/MV3500Cohort2021JulySeptember/homework2/Frank/FrankClient.java b/assignments/src/MV3500Cohort2021JulySeptember/homework2/Frank/FrankClient.java index 1e8440366c..16f36fbb9a 100644 --- a/assignments/src/MV3500Cohort2021JulySeptember/homework2/Frank/FrankClient.java +++ b/assignments/src/MV3500Cohort2021JulySeptember/homework2/Frank/FrankClient.java @@ -15,7 +15,12 @@ import java.net.Socket; * and open the template in the editor. */ /** - * + *This is assignment 2 were I modified TCP example 3 + * If server message is = "this is good bye message from Franks server" the client terminates + * Changed the local host 2318 + * Changed the sleep to 1 second + * Received a message from the server "How are you doing" + * Client sends a message to the server " I'm doing well" * @author justi */ public class FrankClient { @@ -26,7 +31,7 @@ public class FrankClient { /** * Program invocation, execution starts here - * + * If client receives m * @param args command-line arguments * @throws java.lang.InterruptedException user cancels execution */ diff --git a/assignments/src/MV3500Cohort2021JulySeptember/homework2/Frank/FrankServer.java b/assignments/src/MV3500Cohort2021JulySeptember/homework2/Frank/FrankServer.java index 864516dda7..be2b73de07 100644 --- a/assignments/src/MV3500Cohort2021JulySeptember/homework2/Frank/FrankServer.java +++ b/assignments/src/MV3500Cohort2021JulySeptember/homework2/Frank/FrankServer.java @@ -4,16 +4,19 @@ import java.io.*; import java.net.*; + +/** + *This is assignment 2 were I modified TCP example 3 + * I set sever loop count <= 10 and terminates after 10 loops + * sends a message to the client ""this is good bye message from Franks server" + * Sent a message to client "How are you doing" + * Recieves a message from the client "I'm doing well" + * @author justi + */ + public class FrankServer { - /** - * Program invocation, execution starts here If already compiled, can run - * using console in directory ../../build/classes/ by invoking \ java - * -classpath .TcpExamples.TcpExample3Server - * - * @param args command-line arguments - * @throws java.lang.InterruptedException user cancels execution - */ + public static void main(String[] args) throws InterruptedException { try { @@ -48,7 +51,7 @@ public class FrankServer { if (serverLoopCount <= 10) { // checking if the loop count <= 10 ps.println("How are you doing?"); // this gets sent back to client! } else { - ps.println("this is good bye message from Franks server"); // termination after 20 messages + ps.println("this is good bye message from Franks server"); // termination after 10 messages break; // Stop server } // Print some information locally about the Socket connection. -- GitLab