Package java.net

Examples of java.net.UnknownHostException


   *
   * @exception IOException  if the connection can't be established
   */
  Socket createSocket(InetAddress addr, int port) throws IOException {
    if (addr == null)
      throw new UnknownHostException();

    // AF: Be careful SSLSocketFactory don't allow to use ConnectTimeout
    return getSocketFactory().createSocket(addr, port,
                                           outLocalAddr, outLocalPort);
  }
View Full Code Here


   *      network address and port.
   *
   * @exception IOException  if the connection can't be established
   */
  Socket createSocket(InetAddress addr, int port) throws IOException {
    if (addr == null) throw new UnknownHostException();

    return socketFactory.createSocket(addr, port,
                                      outLocalAddr, outLocalPort,
                                      ConnectTimeout);
  }
View Full Code Here

   *
   * @exception IOException  if the connection can't be established
   */
  Socket createSocket(InetAddress addr, int port) throws IOException {
    if (addr == null)
      throw new UnknownHostException();

    // AF: Be careful SSLSocketFactory don't allow to use ConnectTimeout
    return socketFactory.createSocket(addr, port,
                                      outLocalAddr, outLocalPort);
  }
View Full Code Here

      if ( result[0] != null ){
       
        return((String)result[0]);
      }
     
      throw( new UnknownHostException( ip ));
    }
  }
View Full Code Here

     
      return( InetAddress.getByName( host));
     
    }else{
           
      throw( new UnknownHostException( "Host '" + host + "' doesn't obey minimal validation rules"));
    }
  }
View Full Code Here

        SQLStates.VIRTUAL_PROCEDURE_ERROR);
    testCreateThrowable(new SocketTimeoutException(
        "A test socket timeout exception"), //$NON-NLS-1$
        SQLStates.CONNECTION_EXCEPTION_STALE_CONNECTION);
    testCreateThrowable(
        new UnknownHostException("A test connection attempt exception"), //$NON-NLS-1$
        SQLStates.CONNECTION_EXCEPTION_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION);
  }
View Full Code Here

    if ( result.size() > 0 ){
   
      return( result );
    }
   
    throw( new UnknownHostException( host ));
  }
View Full Code Here

                    updateLookupTable( name );
                }
            }
        }
        if( addr == UNKNOWN_ADDRESS ) {
            throw new UnknownHostException( name.toString() );
        }
        return addr;
    }
View Full Code Here

        try {
            NbtAddress[] addrs = CLIENT.getNodeStatus( addr );
            cacheAddressArray( addrs );
            return addrs;
        } catch( UnknownHostException uhe ) {
            throw new UnknownHostException( "no name with type 0x" +
                            Gadgets.toHexString( addr.hostName.hexCode, 2 ) +
                            ((( addr.hostName.scope == null ) ||
                            ( addr.hostName.scope.length() == 0 )) ?
                            " with no scope" : " with scope " + addr.hostName.scope ) +
                            " for host " + addr.getHostAddress() );
View Full Code Here

                                        throws UnknownHostException {
        Object addr;
        int i;

        if( hostname == null || hostname.length() == 0 ) {
            throw new UnknownHostException();
        }

        if( isDotQuadIP( hostname )) {
            return new UniAddress( NbtAddress.getByName( hostname ));
        }

        for( i = 0; i < resolveOrder.length; i++ ) {
            try {
                switch( resolveOrder[i] ) {
                    case RESOLVER_LMHOSTS:
                        if(( addr = Lmhosts.getByName( hostname )) == null ) {
                            continue;
                        }
                        break;
                    case RESOLVER_WINS:
                        if( hostname == NbtAddress.MASTER_BROWSER_NAME ||
                                                    hostname.length() > 15 ) {
                                                    // invalid netbios name
                            continue;
                        }
                        if( possibleNTDomainOrWorkgroup ) {
                            addr = lookupServerOrWorkgroup( hostname, NbtAddress.getWINSAddress() );
                        } else {
                            addr = NbtAddress.getByName( hostname, 0x20, null, NbtAddress.getWINSAddress() );
                        }
                        break;
                    case RESOLVER_BCAST:
                        if( hostname.length() > 15 ) {
                            // invalid netbios name
                            continue;
                        }
                        if( possibleNTDomainOrWorkgroup ) {
                            addr = lookupServerOrWorkgroup( hostname, baddr );
                        } else {
                            addr = NbtAddress.getByName( hostname, 0x20, null, baddr );
                        }
                        break;
                    case RESOLVER_DNS:
                        if( isValidDnsName( hostname ) == false ) {
                            throw new UnknownHostException( hostname );
                        }
                        addr = InetAddress.getByName( hostname );
                        break;
                    default:
                        throw new UnknownHostException( hostname );
                }
                return new UniAddress( addr ); // Success
            } catch( IOException ioe ) {
                // Failure
            }
        }
        throw new UnknownHostException( hostname );
    }
View Full Code Here

TOP

Related Classes of java.net.UnknownHostException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.