Skip to content
Snippets Groups Projects
Commit e48a9e0f authored by KReynolds's avatar KReynolds
Browse files

Customized Homework1 to make it unique.

parent c8032ad1
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,7 @@ public class ReynoldsTcpExample1Telnet1 ...@@ -23,7 +23,7 @@ public class ReynoldsTcpExample1Telnet1
{ {
System.out.println("TcpExample1Telnet has started and is waiting for a connection."); 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(" 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. // The ServerSocket waits for a connection from a client.
// It returns a Socket object when the connection occurs. // It returns a Socket object when the connection occurs.
...@@ -40,10 +40,19 @@ public class ReynoldsTcpExample1Telnet1 ...@@ -40,10 +40,19 @@ public class ReynoldsTcpExample1Telnet1
OutputStream os = clientConnection.getOutputStream(); OutputStream os = clientConnection.getOutputStream();
PrintStream ps = new PrintStream(os); PrintStream ps = new PrintStream(os);
ps.println("Client response was brought to you by the Domo"); // to remote clientnc ps.println("Initiating Client-side handshake... \n"); // to remote clientnc
ps.println("DomsaMom"); ps.println("Requesting authentication...");
System.out.println("Client response was brought to you by the Domo"); // to server console ps.println("Authentication granted \n");
System.out.println("DomsaMom");
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 // "flush()" in important in that it forces a write
// across what is in fact a slow connection // across what is in fact a slow connection
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment