카테고리 없음
실 서버 아이피 가져오기
[czar]
2010. 12. 14. 02:10
InetAddress localHost = InetAddress.getLocalHost();
hostAddr = localHost.getHostAddress();
활용
리얼서버인지..테스트서버인지
public static boolean isRealServer()
{
try
{
InetAddress localHost = InetAddress.getLocalHost();
String hostAddr = localHost.getHostAddress();
if(hostAddr.equals(realWasAddr1) || hostAddr.equals(realWasAddr2)) // 운영WAS
{
return true;
}
else // 테스트WAS
{
return false;
}
}
catch(UnknownHostException e) {
return false;
}
}