ServerSocket.host() returns null
I have the following code to try and determine the hostname of the machine that is running: ServerSocket server = new ServerSocket(25002); String host = server.getHost(); if (host.contains("alex")) { // Do something }
host variable always contains null when running on a linux desktop environment. Can this be fixed?
Or is there some other way to determine the hostname
Thanks Alex.