diff --git a/assignments/src/MV3500Cohort2021JulySeptember/homework1/ReynoldsTcpExample1Telnet1.java b/assignments/src/MV3500Cohort2021JulySeptember/homework1/ReynoldsTcpExample1Telnet1.java index fffbf2d7e4ca972f0c4da1b219af7afc3e3ecda5..bdd513c2188e808e8828793f1a0bc1beb8359b84 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