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

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


        }
    }

    private static void runAsyncClients(SocketAddress server, int nClients, int nSelectors)
            throws Exception {
        ChannelFactory channelFactory = new NioClientSocketChannelFactory(
                Executors.newCachedThreadPool(),
                Executors.newCachedThreadPool(),
                nSelectors);
        allConnected = new CountDownLatch(nClients);
        allFinished = new CountDownLatch(nClients);
View Full Code Here


    ClientBootstrap bootstrap;
    private volatile RpcChannel rpcChannel;

    public RpcClient() {
        ChannelFactory channelFactory = new NioClientSocketChannelFactory(
                Executors.newCachedThreadPool(),
                Executors.newCachedThreadPool());

        bootstrap = new ClientBootstrap(channelFactory);
        bootstrap.setPipelineFactory(new RpcChannelPiplineFactory(this));
View Full Code Here

    {
      this.channelFactory = channelFactory;
    }
    else
    {
      this.channelFactory = new NioClientSocketChannelFactory(boss,
          worker);
    }
    this.bootstrap = new ClientBootstrap(this.channelFactory);
    // At client side option is tcpNoDelay and at server child.tcpNoDelay
    this.bootstrap.setOption("tcpNoDelay", true);
View Full Code Here

    {
      this.channelFactory = channelFactory;
    }
    else
    {
      this.channelFactory = new NioClientSocketChannelFactory(boss,
          worker);
    }
    this.bootstrap = new ClientBootstrap(this.channelFactory);
    // At client side option is tcpNoDelay and at server child.tcpNoDelay
    this.bootstrap.setOption("tcpNoDelay", true);
View Full Code Here

  }

  @Override
  protected void startUp() throws Exception {
    executionHandler = new ExecutionHandler(new OrderedMemoryAwareThreadPoolExecutor(4, 0, 0));
    bootstrap = new ClientBootstrap(new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool()));
    bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
      @Override
      public ChannelPipeline getPipeline() throws Exception {
        final ChannelPipeline pipeline = Channels.pipeline();
View Full Code Here

      Configuration conf = HBaseConfiguration.create();
      conf.set("tso.host", "localhost");
      conf.setInt("tso.port", 1234);

      // Start client with Nb of active threads = 3 as maximum.
      channelFactory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(),
            Executors.newCachedThreadPool(), 3);
      // Create the bootstrap
      // Create the global ChannelGroup
      channelGroup = new DefaultChannelGroup(TransactionClient.class.getName());
      // Create the associated Handler
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

  }
 
  public StrestClient(String host, ExecutorService threadPool) {
    this.host = host;
        bootstrap = new ClientBootstrap(
                new NioClientSocketChannelFactory(
                    threadPool,
                        threadPool));
   
  }
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

  private Protocol remote;

  NettyTransceiver() {}
 
  public NettyTransceiver(InetSocketAddress addr) {
    this(addr, new NioClientSocketChannelFactory(Executors.
        newCachedThreadPool(), Executors.newCachedThreadPool()));
  }
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.