How can I find out who is accessing my TCP server? I would be interested in logging the IP addresses of the clients.
Created May 7, 2012
Krzysztof Raciniewski The client socket contains IP address. The lines below can help you:
Socket socket = new ServerSocket ().accept ();
System.out.println ("Client from " + socket.getInetAddress().getHostAddress());