diff options
author | Mark Spruiell <mes@zeroc.com> | 2001-11-16 21:04:12 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2001-11-16 21:04:12 +0000 |
commit | b5a892db007dc0525386204d94e02859c1b19d62 (patch) | |
tree | 11231e17aabf5559581596efd33d6c89710d88ba /java/src | |
parent | intial check-in (diff) | |
download | ice-b5a892db007dc0525386204d94e02859c1b19d62.tar.bz2 ice-b5a892db007dc0525386204d94e02859c1b19d62.tar.xz ice-b5a892db007dc0525386204d94e02859c1b19d62.zip |
initial check-in
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/IceInternal/Network.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/java/src/IceInternal/Network.java b/java/src/IceInternal/Network.java new file mode 100644 index 00000000000..67bc6733953 --- /dev/null +++ b/java/src/IceInternal/Network.java @@ -0,0 +1,38 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +package IceInternal; + +public final class Network +{ + public static String + getLocalHost(boolean numeric) + { + String host; + + try + { + if (!numeric) + { + host = java.net.InetAddress.getLocalHost().getHostName(); + } + else + { + host = java.net.InetAddress.getLocalHost().getHostAddress(); + } + } + catch(java.net.UnknownHostException ex) + { + throw new Ice.DNSException(); + } + + return host; + } +} |