Package com.aelitis.azureus.core.networkmanager

Examples of com.aelitis.azureus.core.networkmanager.VirtualServerChannelSelector


  public
  PHETester()
  {
    ProtocolDecoder.addSecrets( new byte[][]{ shared_secret });
   
    VirtualServerChannelSelector
      accept_server = VirtualServerChannelSelectorFactory.createNonBlocking(
          new InetSocketAddress( 8765 ),
          0,
          new VirtualServerChannelSelector.SelectListener()
          {
            public void
            newConnectionAccepted(
              ServerSocketChannel  server,
              SocketChannel     channel )
            {     
              incoming( channel );
            }
          });
   
    accept_server.start();
 
    new Thread()
    {
      public void
      run()
View Full Code Here


      {
        COConfigurationManager.setParameter( "network.tcp.port." + tcp_listen_port + ".last.nonlocal.incoming", last_non_local_connection_time );
       
        for (int i = 0; i < serverSelectors.length; i++)
        {
          VirtualServerChannelSelector server_selector = serverSelectors[i];
         
          if (server_selector != null && server_selector.isRunning())
          { //ensure it's actually running
            long accept_idle = SystemTime.getCurrentTime() - server_selector.getTimeOfLastAccept();
            if (accept_idle > 10 * 60 * 1000)
            { //the socket server hasn't accepted any new connections in the last 10min
              //so manually test the listen port for connectivity
              InetAddress inet_address = server_selector.getBoundToAddress();
              try
              {
                if (inet_address == null)
                  inet_address = InetAddress.getByName("127.0.0.1"); //failback
                Socket sock = new Socket(inet_address, tcp_listen_port, inet_address, 0);
View Full Code Here

            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);
            else
              serverSelector = VirtualServerChannelSelectorFactory.createNonBlocking(address, so_rcvbuf_size, selectListener);
            serverSelector.start();
           
            tempSelectors.add(serverSelector);
          }
         
          if(tempSelectors.size() == 0)
View Full Code Here

TOP

Related Classes of com.aelitis.azureus.core.networkmanager.VirtualServerChannelSelector

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.