Examples of NetworkAdminException


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

    try{
      return( VersionCheckClient.getSingleton().getExternalIpAddressUDP(bind_ip, bind_port,false));
     
    }catch( Throwable e ){
   
      throw( new NetworkAdminException( "Outbound test failed", e ));
    }
  }
View Full Code Here

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

            byte[]  ip_bytes = (byte[])reply.get( "ip_address" );

            if ( ip_bytes == null ){

              throw( new NetworkAdminException( "IP address missing in reply" ));
            }

            byte[] reason = (byte[])reply.get( "reason" );

            if ( reason != null ) {

              throw( new NetworkAdminException( new String( reason, "UTF8")));
            }

            return( InetAddress.getByAddress( ip_bytes ));

          }catch( Throwable e){

            last_error  = e;

            timeout += timeout_inc;
          }
        }

        if ( last_error != null ){

          throw( last_error );
        }

        throw( new NetworkAdminException( "Timeout" ));

      }finally{

        try{
          data_to_send.put( "seq", new Long(99));

          long connection_id = 0x8000000000000000L | random.nextLong();

          NetworkAdminNATUDPRequest  request_packet = new NetworkAdminNATUDPRequest( connection_id );

          request_packet.setPayload( data_to_send );

          // fire off one last packet in attempt to inform server of completion

          listener.reportProgress( "Sending completion event" );

          packet_handler.send( request_packet, new InetSocketAddress( UDP_SERVER_ADDRESS, UDP_SERVER_PORT ));

        }catch( Throwable e){ 
        }
      }
    }catch( NetworkAdminException e ){

      throw( e );

    }catch( Throwable e ){

      throw( new NetworkAdminException( "Inbound test failed", e ));

    }finally{

      packet_handler.setExplicitBindAddress( null );
View Full Code Here

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

                    SocketChannel       sc,
                    Object           attachment,
                    Throwable        msg )
                  {
                    result[0]   = RES_PROXY_FAILED;
                    error[0= new NetworkAdminException( "Proxy error", msg );
                   
                    transport.close( "Proxy error" );
                   
                    sem.release();     
                  }
                },
                null );
             
            }catch( Throwable t ) {

              result[0]   = RES_PROXY_FAILED;
              error[0= new NetworkAdminException( "Proxy connect failed", t );
             
              sem.release();            }
          }
         
          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 ){
     
      return( details[0] );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.