I recently started working with sockets in Java and I bounded my server socket with the IP address returned by the static method InetAddress.getLocalHost()
With this my client side was able to connect to the server in most of the cases.
However, it didn't work when my server computer had complex networking. The static method InetAddress.getLocalHost()
returned an address which wasn't reachable by the client machine
I want to know, how can one get the ip address which is reachable by other devices connected to the same network through Java?