Package org.jboss.netty.channel.socket.nio

Examples of org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory


         else
         {
            threadsToUse = this.nioRemotingThreads;
         }

         channelFactory = new NioClientSocketChannelFactory(virtualExecutor, virtualExecutor, threadsToUse);
      }
      else
      {
         channelFactory = new OioClientSocketChannelFactory(virtualExecutor);
      }
View Full Code Here


               if(nioBossPool == null)
               {
                  //only used for connect so 1 will do
                  nioBossPool = new NioClientBossPool(virtualExecutor, 1);
               }
               channelFactory = new NioClientSocketChannelFactory(nioBossPool, nioWorkerPool);
               nioChannelFactoryCount.incrementAndGet();
            }
         }
         else
         {
            channelFactory = new NioClientSocketChannelFactory(virtualExecutor, virtualExecutor, threadsToUse);
         }

      }
      else
      {
View Full Code Here

         else
         {
            threadsToUse = this.nioRemotingThreads;
         }

         channelFactory = new NioClientSocketChannelFactory(virtualExecutor, virtualExecutor, threadsToUse);
      }
      else
      {
         channelFactory = new OioClientSocketChannelFactory(virtualExecutor);
      }
View Full Code Here

         else
         {
            threadsToUse = this.nioRemotingThreads;
         }

         channelFactory = new NioClientSocketChannelFactory(virtualExecutor, virtualExecutor, threadsToUse);
      }
      else
      {
         channelFactory = new OioClientSocketChannelFactory(virtualExecutor);
      }
View Full Code Here

         else
         {
            threadsToUse = this.nioRemotingThreads;
         }

         channelFactory = new NioClientSocketChannelFactory(virtualExecutor, virtualExecutor, threadsToUse);
      }
      else
      {
         channelFactory = new OioClientSocketChannelFactory(virtualExecutor);
      }
View Full Code Here

        if (channelFactory == null) {
            ExecutorService bossExecutor = context.getExecutorServiceStrategy().newThreadPool(this, "NettyTCPBoss",
                    configuration.getCorePoolSize(), configuration.getMaxPoolSize());
            ExecutorService workerExecutor = context.getExecutorServiceStrategy().newThreadPool(this, "NettyTCPWorker",
                    configuration.getCorePoolSize(), configuration.getMaxPoolSize());
            channelFactory = new NioClientSocketChannelFactory(bossExecutor, workerExecutor);
        }
    }
View Full Code Here

  public void init(InetSocketAddress addr, ChannelPipelineFactory pipeFactory) {
    this.addr = addr;

    this.factory =
        new NioClientSocketChannelFactory(Executors.newCachedThreadPool(),
            Executors.newCachedThreadPool());

    this.bootstrap = new ClientBootstrap(factory);
    this.bootstrap.setPipelineFactory(pipeFactory);
    // TODO - should be configurable
View Full Code Here

    }
  }

  public File get() throws IOException {
    ClientBootstrap bootstrap = new ClientBootstrap(
        new NioClientSocketChannelFactory(Executors.newCachedThreadPool(),
            Executors.newCachedThreadPool()));
    bootstrap.setOption("connectTimeoutMillis", 5000L); // set 5 sec
    bootstrap.setOption("receiveBufferSize", 1048576); // set 1M
    ChannelPipelineFactory factory = new HttpClientPipelineFactory(file);
    bootstrap.setPipelineFactory(factory);
View Full Code Here

        base_sleep_ms = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_MIN_SLEEP_MS));
        max_sleep_ms = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_MAX_SLEEP_MS));
        int maxWorkers = Utils.getInt(storm_conf.get(Config.STORM_MESSAGING_NETTY_CLIENT_WORKER_THREADS));

        if (maxWorkers > 0) {
            factory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool(), maxWorkers);
        } else {
            factory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool());
        }
        bootstrap = new ClientBootstrap(factory);
        bootstrap.setOption("tcpNoDelay", true);
        bootstrap.setOption("sendBufferSize", buffer_size);
        bootstrap.setOption("keepAlive", true);
View Full Code Here

    }

    @SuppressWarnings("unused")
    private static void runSyncClients(InetSocketAddress server, int nClients, int nSelectors)
            throws InterruptedException {
        ChannelFactory channelFactory = new NioClientSocketChannelFactory(
                Executors.newCachedThreadPool(),
                Executors.newCachedThreadPool(),
                nSelectors);
        allConnected = new CountDownLatch(nClients);
        startLatch = new CountDownLatch(1);
View Full Code Here

TOP

Related Classes of org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory

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.