ASKER
InetAddress iaa = InetAddress.getLocalHost();
String hostName = iaa.getHostName();
InetAddress [] iad;
iad = InetAddress.getAllByName(hostName);
for (int jj=0; jj<iad.length; jj++){
Ssytem.out.println( iad[jj].getHostAddress());
}
ASKER
out.println("getRemoteHost=" + request.getRemoteHost() + "<br/>\n");
InetAddress iaa = InetAddress.getLocalHost();
String hostName = iaa.getHostName();
InetAddress[] iad;
iad = InetAddress.getAllByName(hostName);
for (int jj = 0; jj < iad.length; jj++)
{
out.println("InetAddress[" + jj + "]=" + iad[jj].getHostAddress() + "<br/>\n");
}
The above code gives me the following out put:ASKER
getRemoteHost=fe80:0:0:0:2535:6f9d:9f4b:dad3
getHostAddress=172.19.52.36
InetAddress[0]=172.19.52.36
InetAddress[1]=192.168.186.1
InetAddress[2]=192.168.133.1
InetAddress[3]=fe80:0:0:0:2535:6f9d:9f4b:dad3%13
InetAddress[4]=fe80:0:0:0:80ff:f97d:b79a:20b7%14
InetAddress[5]=fe80:0:0:0:fcd5:1cdf:3f65:e23e%16
InetAddress[6]=fd01:1111:1:52:2535:6f9d:9f4b:dad3
ASKER
ASKER
ASKER
ASKER
Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.
TRUSTED BY
I'm assuming a local login might have an IP like 192.168.7.15 while a remote would be something that doesn't start with 192.168
I don't know if that solves your problem or not. Depends on what you mean by local and remote.