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

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


   public void startTransport(int idleTimeout, boolean tcpNoDelay, int sendBufSize, int recvBufSize, TypedProperties typedProps) {
      InetSocketAddress address = new InetSocketAddress(getHost(), getPort());
      Executor masterExecutor = Executors.newCachedThreadPool();
      Executor workerExecutor = Executors.newCachedThreadPool();

      NioServerSocketChannelFactory factory = new NioServerSocketChannelFactory(masterExecutor, workerExecutor, workerThreads());

      // Configure the server.
      ServerBootstrap bootstrap = new ServerBootstrap(factory);

      // Set up the event pipeline factory.
View Full Code Here


    } catch (ClassCastException e) {
      LOG.warn("Netty worker thread pool is not of type ThreadPoolExecutor", e);
    }
    LOG.info("Netty starting up with a maximum of " + maximumPoolSize +
        " worker threads");
    channelFactory = new NioServerSocketChannelFactory(
        Executors.newCachedThreadPool(bossFactory),
        workerThreadPool, maximumPoolSize);
  }
View Full Code Here

         else
         {
            threadsToUse = this.nioRemotingThreads;
         }

         channelFactory = new NioServerSocketChannelFactory(bossExecutor, workerExecutor, threadsToUse);
      }
      else
      {
         channelFactory = new OioServerSocketChannelFactory(bossExecutor, workerExecutor);
      }
View Full Code Here

         else
         {
            threadsToUse = this.nioRemotingThreads;
         }

         channelFactory = new NioServerSocketChannelFactory(bossExecutor, workerExecutor, threadsToUse);
      }
      else
      {
         channelFactory = new OioServerSocketChannelFactory(bossExecutor, workerExecutor);
      }
View Full Code Here

        if(host == null || port == null || "".equals(host.trim()) || port == 0) {
            throw new JBNodeException("Both host and port must be specified.");
        }

        ServerBootstrap bootstrap = new ServerBootstrap(
                new NioServerSocketChannelFactory(
                        Executors.newCachedThreadPool(),
                        Executors.newCachedThreadPool(), 10));


View Full Code Here

  public void test() throws Exception {
    final CountDownLatch waitLatch = new CountDownLatch(1);
    server = new NettyServer(
        new SpecificResponder(Simple.class, new SimpleImpl(waitLatch)),
        new InetSocketAddress(0),
        new NioServerSocketChannelFactory
          (Executors.newCachedThreadPool(), Executors.newCachedThreadPool()),
        new ExecutionHandler(Executors.newCachedThreadPool()));
    server.start();
   
    transceiver = new NettyTransceiver(new InetSocketAddress(
View Full Code Here

public class TestNettyServerWithCompression extends TestNettyServer{


  protected static Server initializeServer(Responder responder) {
    ChannelFactory channelFactory = new NioServerSocketChannelFactory(
        Executors.newCachedThreadPool(),
        Executors.newCachedThreadPool()
    );
    return  new NettyServer(responder, new InetSocketAddress(0),
        channelFactory, new CompressionChannelPipelineFactory(),
View Full Code Here

public class TestNettyServerWithSSL extends TestNettyServer{
  public static final String TEST_CERTIFICATE = "servercert.p12";
  public static final String TEST_CERTIFICATE_PASSWORD = "s3cret";
 
  protected static Server initializeServer(Responder responder) {
    ChannelFactory channelFactory = new NioServerSocketChannelFactory(
        Executors.newCachedThreadPool(),
        Executors.newCachedThreadPool()
    );
    return new NettyServer(responder, new InetSocketAddress(0),
        channelFactory, new SSLChannelPipelineFactory(),
View Full Code Here

        ExecutorService bossExecutor = context.getExecutorServiceStrategy().newThreadPool(this, "NettyTCPBoss",
                configuration.getCorePoolSize(), configuration.getMaxPoolSize());
        ExecutorService workerExecutor = context.getExecutorServiceStrategy().newThreadPool(this, "NettyTCPWorker",
                configuration.getCorePoolSize(), configuration.getMaxPoolSize());

        channelFactory = new NioServerSocketChannelFactory(bossExecutor, workerExecutor);
        serverBootstrap = new ServerBootstrap(channelFactory);
        serverBootstrap.setPipelineFactory(new ServerPipelineFactory(this));
        serverBootstrap.setOption("child.keepAlive", configuration.isKeepAlive());
        serverBootstrap.setOption("child.tcpNoDelay", configuration.isTcpNoDelay());
        serverBootstrap.setOption("child.reuseAddress", configuration.isReuseAddress());
View Full Code Here

    this.serviceName = name;
  }

  public void init(ChannelPipelineFactory pipeline) {
    this.factory =
        new NioServerSocketChannelFactory(Executors.newCachedThreadPool(),
            Executors.newCachedThreadPool());

    pipelineFactory = pipeline;
    bootstrap = new ServerBootstrap(factory);
    bootstrap.setPipelineFactory(pipelineFactory);
View Full Code Here

TOP

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

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.