Code example for UnknownHostException

Methods: toString

0
                } else { 
                    InetAddress local = null;
                    try { 
                        local = InetAddress.getLocalHost();
                    } catch (UnknownHostException e) {
                        throw new SocketException("getLocalHost(): " + e.toString());
                    } 
                    if (inet.equals(local)) {
                        ipaddress = ((InetAddress) val).getAddress();
                    } else { 
                        throw new SocketException(val + " != getLocalHost(): " + local);
                    } 
                } 
            } 
            /* 
             * save this value as it is actually used differently for IPv4 and 
             * IPv6 so we cannot get the value using the getOption. The option 
             * is actually only set for IPv4 and a masked version of the value 
             * will be set as only a subset of the values are allowed on the 
             * socket. Therefore we need to retain it to return the value that 
             * was set. We also need the value to be passed into a number of