Skip to content
Snippets Groups Projects
Commit 633d97a9 authored by Brutzman, Don's avatar Brutzman, Don
Browse files

add diagnostic for host name, note this might only show up for your system's...

 add diagnostic for host name, note this might only show up for your system's telnet connection since hostnames aren't part of TCP
parent 47d4e082
No related branches found
No related tags found
No related merge requests found
......@@ -98,8 +98,11 @@ public class TcpExample2ConnectionCounting
// // Where are we? In other words, what is our host number? Advertise it.
// // Note that we use the serverSocket to get address, since host may have multiple network connections.
// // https://stackoverflow.com/questions/9481865/getting-the-ip-address-of-the-current-machine-using-java
// String localHostAddress = clientConnection.getInetAddress().getHostAddress();
// String localHostAddress = clientConnectionSocket.getInetAddress().getHostAddress();
// System.out.println("Local host address is " + localHostAddress);
// // add diagnostic for host name, note this might only show up for your system's telnet connection since hostnames aren't part of TCP
// String localHostName = clientConnectionSocket.getInetAddress().getHostName();
// System.out.println("Local host name is " + localHostName);
// if (localHostAddress.contains("/"))
// localHostAddress = localHostAddress.substring(localHostAddress.indexOf("/")+1);
// // show localhost IP number to facilitate connections over local area network (LAN, WAN)
......
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