Package java.net

Examples of java.net.InetAddress$WaitReachable


                    // if listener is null the request has been cancelled
                 
                  if ( listener != null ){
                   
                    try{
                      InetAddress addr = InetAddress.getByName( req.getIP());
                       
                      req.getListener().IPResolutionComplete( addr.getHostName(), true );
                       
                    }catch( Throwable e ){
                     
                      req.getListener().IPResolutionComplete( req.getIP(), false );
                     
View Full Code Here


       
        return( last_public_ip_address );
      }
    }
   
    InetAddress res  = null;
   
    try{
     
      String  vc_ip = VersionCheckClient.getSingleton().getExternalIpAddress( false, false );
     
View Full Code Here

                   
                    request_queue_mon.exit();
                  }
                 
                  try{
                    InetAddress addr = syncResolve( req.getHost());
                   
                    req.getListener().hostNameResolutionComplete( addr );
                     
                  }catch( Throwable e ){
                   
View Full Code Here

        try {
            System.out.println("localhost:" + InetAddress.getByName("localhost"));
            for (InetAddress address : InetAddress.getAllByName("localhost")) {
                System.out.println("  " + address);
            }
            InetAddress localhost = InetAddress.getLocalHost();
            System.out.println("getLocalHost:" + localhost);
            for (InetAddress address : InetAddress.getAllByName(localhost.getHostAddress())) {
                System.out.println("  " + address);
            }
            InetAddress address = InetAddress.getByName(localhost.getHostAddress());
            System.out.println("byName:" + address);
            ServerSocket serverSocket;
            try {
                serverSocket = new ServerSocket(0);
            } catch (Exception e) {
View Full Code Here

                reply(227, "Passive Mode (" + serverIpAddress + "," + (port >> 8) + "," + (port & 255) + ")");
            } else if ("PORT".equals(command)) {
                String[] list = StringUtils.arraySplit(param, ',', true);
                String host = list[0] + "." + list[1] + "." + list[2] + "." + list[3];
                int port = (Integer.parseInt(list[4]) << 8) | Integer.parseInt(list[5]);
                InetAddress address = InetAddress.getByName(host);
                if (address.equals(control.getInetAddress())) {
                    data = new FtpData(server, address, port);
                    reply(200, "Ok");
                } else {
                    server.trace("Port REJECTED:" + address + " expected:" + control.getInetAddress());
                    reply(550, "Failed");
View Full Code Here

        addTLV( new TLV(TLVConstants.TLV_TYPE_USER_STATUS_FLAGS, flags ) );

        // allocate bytes for the DC Info block
        byte[] dcinfo = new byte[ 0x25 ];

        InetAddress addr;
        try {
            addr = InetAddress.getLocalHost();
            byte[] ipAddr = addr.getAddress();
            System.arraycopy(ipAddr, 0, dcinfo, 0, ipAddr.length);
        } catch (UnknownHostException e) {
            // TODO Auto-generated catch block
        }
       
View Full Code Here

        for (int i = 0; i < 4; i++) {
            buff.appendExceptFirst(".");
            buff.append(address[i]);
        }
        String ip = buff.toString();
        InetAddress addr = InetAddress.getByName(ip);
        int port = (Integer.parseInt(address[4]) << 8) | Integer.parseInt(address[5]);
        socketData = NetUtils.createSocket(addr, port, false);
        inData = socketData.getInputStream();
        outData = socketData.getOutputStream();
    }
View Full Code Here

     *         which the request was received.
     *
     * @since 2.4
     */
    public String getLocalName() {
      InetAddress ia = socket/* serve.serverSocket */.getLocalAddress();
      return ia == null ? null : ia.getCanonicalHostName(); /* 1.4 */
    }
 
View Full Code Here

     *
     * @since 2.4
     *
     */
    public String getLocalAddr() {
      InetAddress ia = /* serve.serverSocket */socket.getLocalAddress();
      return ia == null ? null : ia.getHostAddress();
    }
View Full Code Here

  private void open() throws NamingException {
    if (Trace.logger.isLoggable(BasicLevel.DEBUG))
      Trace.logger.log(BasicLevel.DEBUG,
                       "SimpleNamingConnection.open()");
    try {
      InetAddress addr = InetAddress.getByName(hostName);
      Socket socket = socketFactory.createSocket(addr, port, connectTimeout);
      ioCtrl = new IOControl(socket);
    } catch (IOException exc) {
      if (Trace.logger.isLoggable(BasicLevel.DEBUG))
        Trace.logger.log(BasicLevel.DEBUG,
View Full Code Here

TOP

Related Classes of java.net.InetAddress$WaitReachable

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.