How can I find out who is accessing my TCP server? I would be interested in logging the IP addresses of the clients.

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());
About | Sitemap | Contact
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.