Package com.aelitis.azureus.core.networkmanager.admin

Examples of com.aelitis.azureus.core.networkmanager.admin.NetworkAdminException


     
      timeout -= (end - start );
     
      if ( timeout <= 0 ){
       
        throw( new NetworkAdminException( "Timeout on connect" ));
       
      }else if ( timeout > TIMEOUT ){
       
        timeout = TIMEOUT;
      }
     
      socket.setSoTimeout( timeout );
     
      try{
        OutputStream  os = socket.getOutputStream();
       
        String  command = "-u -p " + address.getHostAddress() + "\r\n";
       
        os.write( command.getBytes());
       
        os.flush();
       
        InputStream  is = socket.getInputStream();
       
        byte[]  buffer = new byte[1024];
       
        String  result = "";
       
        while( true ){
         
          int  len = is.read( buffer );
         
          if ( len <= 0 ){
           
            break;
          }
         
          result += new String( buffer, 0, len );
        }

        return( processResult( result ));

      }finally{
       
        socket.close();
      }
    }catch( Throwable e ){
     
      throw( new NetworkAdminException( "whois connection failed", e ));
   
  }
View Full Code Here


            }
          }
        }
      }
     
      throw( new NetworkAdminException( "DNS query returned no results" ));
     
    }catch( Throwable e ){
     
      throw( new NetworkAdminException( "DNS query failed", e ));
     
    }finally{
     
      if ( context != null ){
       
View Full Code Here

  public String[]
  getVersionsSupported()
 
    throws NetworkAdminException
  {
    NetworkAdminException  failure = null;
   
    List  versions = new ArrayList();
   
    try{
      testVersion( "V4" );
View Full Code Here

                  Throwable failure_msg )
                {
                  transport.close( "Proxy login failed" );
                 
                  result[0]   = RES_SOCKS_FAILED;
                  error[0= new NetworkAdminException( "Proxy connect failed", failure_msg );
                 
                  sem.release();
                }
              },
              version,
              user,
              password );
        }
 
        public void
        connectFailure(
          Throwable failure_msg )
        {
          result[0]   = RES_CONNECT_FAILED;
          error[0= new NetworkAdminException( "Connect failed", failure_msg );
         
          sem.release();
        }
      };
 
      TCPNetworkManager.getSingleton().getConnectDisconnectManager().requestNewConnection(
          socks_address, connect_listener, ProtocolEndpoint.CONNECT_PRIORITY_MEDIUM );
           
    }catch( Throwable e ){
     
      result[0]   = RES_CONNECT_FAILED;
      error[0= new NetworkAdminException( "Connect failed", e );
     
      sem.release();
    }
   
    if ( !sem.reserve(10000)){
     
      result[0]   = RES_CONNECT_FAILED;
      error[0]   = new NetworkAdminException( "Connect timeout" );
    }
   
    if ( result[0] != RES_OK ){
       
      throw( error[0] );
View Full Code Here

 
    throws NetworkAdminException
  {
    if ( bind_ip != null || bind_port != 0 ){
     
      throw( new NetworkAdminException("HTTP tester doesn't support local bind options"));
    }
   
    try{
        //   try to use our service first
     
      return( VersionCheckClient.getSingleton().getExternalIpAddressHTTP(false));
     
    }catch( Throwable e ){
     
        // fallback to something else
     
      try{
        URL  url = new URL( "http://www.google.com/" );
       
        URLConnection connection = url.openConnection();
       
        connection.setConnectTimeout( 10000 );
       
        connection.connect();
       
        return( null );
       
      }catch( Throwable f ){
     
        throw( new NetworkAdminException( "Outbound test failed", e ));
      }
    }
  }
View Full Code Here

     
      return( checker.getExternalAddress());
     
    }else{
     
      throw( new NetworkAdminException( "NAT check failed: " + checker.getAdditionalInfo()));
    }
  }
View Full Code Here

         
          return( null );
         
      }catch( Throwable f ){

        throw( new NetworkAdminException( "Outbound test failed", e ));
      }
    }
  }
View Full Code Here

     
      return( checker.getExternalAddress());
     
    }else{
     
      throw( new NetworkAdminException( "NAT test failed: " + checker.getAdditionalInfo()));
    }
  }
View Full Code Here

    try{
      return( InetAddress.getByName( bgp_prefix.substring(0,pos)));
     
    }catch( Throwable e ){
     
      throw( new NetworkAdminException( "Parse failure for '" + bgp_prefix + "'", e ));
    }
  }
View Full Code Here

     
      return( InetAddress.getByAddress( bytes ));
     
    }catch( Throwable e ){
     
      throw( new NetworkAdminException( "Parse failure for '" + bgp_prefix + "'", e ));
    }   
  }
View Full Code Here

TOP

Related Classes of com.aelitis.azureus.core.networkmanager.admin.NetworkAdminException

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.