hello everyone!!!
I am currently working in socket programming in java and I am creating a simple chat application...
To go directly to my question,
ServerSocket server = new ServerSocket(1024);
Socket socket = server.accept();
String hostname = socket.getInetAddress().getHostName();
System.out.println(hostname);
If I will run my Server program, the output will be 0:0:0:0:0:0:0:1.
How can i interpret this? I want to print the hostname or the ip address of the client.
By the way, I am working in a localhost....