Posted on 2004-10-25
hi, I have a little problem when I'm trying to check my hostname,
here is the code
server = new ServerSocket(4000,1);
// 0.0.0.0 <- ?
connection = server.accept();
System.out.println("Connected on "+ connection.getInetAddress().getHostName());
// Connected on SAPPHIRE
I need to have in my application my IP as well but I don't know how to get it.
I tried this
But it gives me my local hostname & IP, //rockstar/192.168.1.4
but I need my IP to the Net //184.108.40.206 for example