diff --git a/assignments/src/MV3500Cohort2019JulySeptember/homework1/BoronTcpExample1Telnet1.java b/assignments/src/MV3500Cohort2019JulySeptember/homework1/BoronTcpExample1Telnet1.java index 9d3bbdb3dff6be1f4579c5a1563c428cd065203c..a38074ce5fbb6c0c186f8f8eb6881c8ed5dd7039 100644 --- a/assignments/src/MV3500Cohort2019JulySeptember/homework1/BoronTcpExample1Telnet1.java +++ b/assignments/src/MV3500Cohort2019JulySeptember/homework1/BoronTcpExample1Telnet1.java @@ -36,6 +36,12 @@ public class BoronTcpExample1Telnet1 { try { + InetAddress ip; + String hostname; + + ip = InetAddress.getLocalHost(); + hostname = ip.getHostName(); + 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)..." ); @@ -56,7 +62,8 @@ public class BoronTcpExample1Telnet1 Timestamp timestamp = new Timestamp(System.currentTimeMillis()); ps.println("This client response was written by Capt. Jonathan Boron."); // to remote clientnc - ps.println("Connection achieved at time: " + timestamp); + ps.println("Name/IP Address for host: " + ip); + ps.println("Connection achieved at date/time: " + timestamp); System.out.println("This server response was written by Capt. Jonathan Boron."); // to server console System.out.println("Connection achieved at time: " + timestamp);