From e48a9e0f94d314982f8ff3240c855c7402df994e Mon Sep 17 00:00:00 2001 From: KReynolds <runem@10.0.0.35> Date: Tue, 14 Sep 2021 22:23:00 -0700 Subject: [PATCH] Customized Homework1 to make it unique. --- .../homework1/ReynoldsTcpExample1Telnet1.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/assignments/src/MV3500Cohort2021JulySeptember/homework1/ReynoldsTcpExample1Telnet1.java b/assignments/src/MV3500Cohort2021JulySeptember/homework1/ReynoldsTcpExample1Telnet1.java index fffbf2d7e4..bdd513c218 100644 --- a/assignments/src/MV3500Cohort2021JulySeptember/homework1/ReynoldsTcpExample1Telnet1.java +++ b/assignments/src/MV3500Cohort2021JulySeptember/homework1/ReynoldsTcpExample1Telnet1.java @@ -23,7 +23,7 @@ public class ReynoldsTcpExample1Telnet1 { 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)..." ); + System.out.println(" enter (telnet localhost 2317) or (nc localhost 2317)... \n" ); // The ServerSocket waits for a connection from a client. // It returns a Socket object when the connection occurs. @@ -40,10 +40,19 @@ public class ReynoldsTcpExample1Telnet1 OutputStream os = clientConnection.getOutputStream(); PrintStream ps = new PrintStream(os); - ps.println("Client response was brought to you by the Domo"); // to remote clientnc - ps.println("DomsaMom"); - System.out.println("Client response was brought to you by the Domo"); // to server console - System.out.println("DomsaMom"); + ps.println("Initiating Client-side handshake... \n"); // to remote clientnc + ps.println("Requesting authentication..."); + ps.println("Authentication granted \n"); + + ps.println("Secret message sent to host \n"); + ps.println("Disconnecting from host..."); + + System.out.println("Conducting server-side handshake..."); // to server console + System.out.println("Granting authentication \n"); + + System.out.println("Secret message recieved from client..."); + System.out.println("Client sent 'hello' message \n"); + System.out.println("Disconnecting connection to client... \n"); // "flush()" in important in that it forces a write // across what is in fact a slow connection -- GitLab