Package java.net

Examples of java.net.InetSocketAddress


    final int[]  result = { RES_CONNECT_FAILED };
   
    final NetworkAdminException[]  error = { null };
   
    try{
      InetSocketAddress    socks_address = new InetSocketAddress( InetAddress.getByName( host ), Integer.parseInt(port));
     
      final InetSocketAddress  target_address = new InetSocketAddress( TARGET_HOST, TARGET_PORT );
     
      TCPConnectionManager.ConnectListener connect_listener =
        new TCPConnectionManager.ConnectListener()
      {
        public int
View Full Code Here


   
    String  default_ip = _default_ip==null?(v6?"::1":"127.0.0.1"):_default_ip;
       
    getExternalAddress( default_ip, logger );
   
    InetSocketAddress  address = new InetSocketAddress( external_address, port );

    DHTNetworkPositionManager.addProviderListener(
      new DHTNetworkPositionProviderListener()
      {
        public void
View Full Code Here

    }else{
     
      external_address = "127.0.0.1";
    }
   
    InetSocketAddress  address = new InetSocketAddress( external_address, port );
   
    local_contact = new DHTTransportUDPContactImpl( true, this, address, address, protocol_version, local_contact.getInstanceID(), 0 );   

    for (int i=0;i<listeners.size();i++){
     
View Full Code Here

         
          for (int i=0;i<search_lim;i++){
           
            DHTTransportUDPContactImpl  contact = (DHTTransportUDPContactImpl)contacts.remove((int)(contacts.size()*Math.random()));
                         
            InetSocketAddress a = askContactForExternalAddress( contact );
           
            if ( a != null && a.getAddress() != null ){
             
              String  ip = a.getAddress().getHostAddress();
             
              if ( returned_address == null ){
               
                returned_address = ip;
                                 
View Full Code Here

  }
 
  protected void
  setLocalContact()
  {
    InetSocketAddress  s_address = new InetSocketAddress( external_address, port );
   
    try{
      local_contact = new DHTTransportUDPContactImpl( true, DHTTransportUDPImpl.this, s_address, s_address, protocol_version, random.nextInt(), 0);
 
      logger.log( "External address changed: " + s_address );
View Full Code Here

    }
   
    try{     
      stats.incomingRequestReceived( request, alien );
     
      InetSocketAddress  transport_address = request.getAddress();
     
      DHTTransportUDPContactImpl  originating_contact =
        new DHTTransportUDPContactImpl(
            false,
            this,
View Full Code Here

          last_non_local_connection_time = SystemTime.getCurrentTime();
        }
       
        if (serverSelectors.length == 0)
        {
          InetSocketAddress address;
          InetAddress[] bindAddresses = getEffectiveBindAddresses();
         
          List tempSelectors = new ArrayList(bindAddresses.length);
         
         
          listenFailCounts = new int[bindAddresses.length];
          for (int i = 0; i < bindAddresses.length; i++)
          {
            InetAddress bindAddress = bindAddresses[i];

            if(!NetworkAdmin.getSingleton().hasIPV6Potential(true) && bindAddress instanceof Inet6Address)
              continue;
           
            if (bindAddress != null)
              address = new InetSocketAddress(bindAddress, tcp_listen_port);
            else
              address = new InetSocketAddress(tcp_listen_port);
           
            VirtualServerChannelSelector serverSelector;
           
            if(bindAddresses.length == 1)
              serverSelector = VirtualServerChannelSelectorFactory.createBlocking(address, so_rcvbuf_size, selectListener);
View Full Code Here

    }
    catch( Throwable t ) {
      t.printStackTrace();
    }
   
  InetSocketAddress tcp_address = new InetSocketAddress( channel.socket().getInetAddress(), channel.socket().getPort());

  ConnectionEndpoint  co_ep = new ConnectionEndpoint(tcp_address);

  ProtocolEndpointTCP  pe_tcp = (ProtocolEndpointTCP)ProtocolEndpointFactory.createEndpoint( ProtocolEndpoint.PROTOCOL_TCP, co_ep, tcp_address );
View Full Code Here

          log( "Invalid address - use <host>:<port> " );
         
          return( bt_tester );
        }
       
        InetSocketAddress address = new InetSocketAddress( bits[0].trim(), Integer.parseInt( bits[1].trim()));
        
        DistributedDatabaseContact contact = ddb.importContact( address );

        tryTest( bt_tester, contact );
      }
View Full Code Here

 
  protected InetSocketAddress
  adjustLoopback(
    InetSocketAddress  address )
  {
    InetSocketAddress local = dht_plugin.getLocalAddress().getAddress();
   
    if ( local.getAddress().getHostAddress().equals( address.getAddress().getHostAddress())){
     
      return( new InetSocketAddress( "127.0.0.1", address.getPort()));
     
    }else{
     
      return( address );
    }
View Full Code Here

TOP

Related Classes of java.net.InetSocketAddress

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.