From 221026b619e48520c7b9f085bbb2665c39a84cb9 Mon Sep 17 00:00:00 2001 From: snapp <snapp@MSI.attlocal.net> Date: Fri, 6 Aug 2021 10:43:25 -0700 Subject: [PATCH] Updated AllenTcpExample3Client.java and AllenTcpExample3Server.java in homework2 folder --- .../homework2/AllenTcpExample3Client.java | 11 +++++------ .../homework2/AllenTcpExample3Server.java | 5 ++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/assignments/src/MV3500Cohort2021JulySeptember/homework2/AllenTcpExample3Client.java b/assignments/src/MV3500Cohort2021JulySeptember/homework2/AllenTcpExample3Client.java index 7ee2cd09a5..ef9b10791b 100644 --- a/assignments/src/MV3500Cohort2021JulySeptember/homework2/AllenTcpExample3Client.java +++ b/assignments/src/MV3500Cohort2021JulySeptember/homework2/AllenTcpExample3Client.java @@ -11,8 +11,7 @@ import java.net.*; * same string telnet printed, sent by the server. The output at the server will * show different socket pairs for each time the loop iterates. * - * @author mcgredo - * @author brutzman + * @author snapp */ public class AllenTcpExample3Client { @@ -59,10 +58,10 @@ public class AllenTcpExample3Client { // from the server instead of one only. serverMessage = br.readLine(); System.out.println("=================================================="); - - System.out.print ("Client loop " + clientLoopCount + ": "); - System.out.println("now we're talking!"); - System.out.println("The message the server sent was: '" + serverMessage + "'"); + System.out.println("Sorry, my dog ate my homework."); + System.out.println("The AllenServer responds with: " + serverMessage + "'"); + System.out.println("Yeah, it took him a few bytes! This this my " + clientLoopCount +" time trying to contact you."); + // socket gets closed, either automatically/silently by this code (or possibly by the server) Thread.sleep(500l); // slow things down, for example 500l (long) = 500 msec diff --git a/assignments/src/MV3500Cohort2021JulySeptember/homework2/AllenTcpExample3Server.java b/assignments/src/MV3500Cohort2021JulySeptember/homework2/AllenTcpExample3Server.java index a67399ba2b..912102f5ec 100644 --- a/assignments/src/MV3500Cohort2021JulySeptember/homework2/AllenTcpExample3Server.java +++ b/assignments/src/MV3500Cohort2021JulySeptember/homework2/AllenTcpExample3Server.java @@ -19,8 +19,7 @@ import java.net.*; * * and have the instructor display the socket pairs received. * - * @author mcgredo - * @author brutzman + * @snapp */ public class AllenTcpExample3Server { @@ -58,7 +57,7 @@ public class AllenTcpExample3Server { // Now hook everything up (i.e. set up the streams), Java style: os = clientConnectionSocket.getOutputStream(); ps = new PrintStream(os); - ps.println("This is response " + serverLoopCount + " produced by the server."); // this gets sent back to client! + ps.println("This is response " + serverLoopCount + " produced by the server. Your dog ate your coding assignment?"); // this gets sent back to client! // Print some information locally about the Socket connection. // This includes the port and IP numbers on both sides (the socket pair). -- GitLab