Skip to content
Snippets Groups Projects
Commit 3714ca1d authored by Simon32220's avatar Simon32220
Browse files

Homework1

parent 324351da
No related branches found
No related tags found
No related merge requests found
......@@ -3,5 +3,5 @@
***
## Description
Just in work
Modification of TcpExample1Telnet.java
package MV3500Cohort2024JulySeptember.homework1.Schnitzler;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.net.ServerSocket;
......@@ -26,7 +27,7 @@ public class SchnitzlerUnicastNetworking {
{
System.out.println(SchnitzlerUnicastNetworking.class.getName() + " has started and is waiting for a connection.");
System.out.println(" help: https://savage.nps.edu/Savage/developers.html#telnet");
System.out.println(" terminal: enter (telnet localhost 2317) or, for macOS (nc localhost 2317)..." );
System.out.println(" terminal: enter (telnet localhost 2317) or, for macOS (nc localhost 2317) to connect to the socket..." );
// The ServerSocket waits for a connection from a client.
// It returns a Socket object when the connection occurs.
......@@ -45,6 +46,7 @@ public class SchnitzlerUnicastNetworking {
OutputStream os = clientConnection.getOutputStream();
PrintStream ps = new PrintStream(os);
ps.println("This client response was written by server " + SchnitzlerUnicastNetworking.class.getName()); // to remote client
System.out.println("This server response was written by server " + SchnitzlerUnicastNetworking.class.getName()); // to server console
......
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