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

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


    private static DuplexTcpServerBootstrap startProtoServer(int port) {
        PeerInfo serverInfo = new PeerInfo("0.0.0.0", port);
        DuplexTcpServerBootstrap bootstrap = new DuplexTcpServerBootstrap(
                serverInfo,
                new NioServerSocketChannelFactory(
                        Executors.newCachedThreadPool(),
                        Executors.newCachedThreadPool())
        );
        ThreadPoolCallExecutor pool = new ThreadPoolCallExecutor(10, 10);
        bootstrap.setRpcServerCallExecutor(pool);
View Full Code Here


    }

    @Override
    protected Bootstrap getBootstrap() {
        final ServerBootstrap bootstrap =
                new ServerBootstrap(new NioServerSocketChannelFactory(bossExecutor, workerExecutor));

        bootstrap.setOption("receiveBufferSizePredictorFactory", new FixedReceiveBufferSizePredictorFactory(8192));
        bootstrap.setOption("child.receiveBufferSize", getRecvBufferSize());

        return bootstrap;
View Full Code Here

        return new InstrumentedThreadFactory(
                new ThreadFactoryBuilder().setNameFormat(nameFormat).build(), metricRegistry);
    }

    private static ServerBootstrap buildServerBootStrap(final ExecutorService bossExecutor, final ExecutorService workerExecutor) {
        return new ServerBootstrap(new NioServerSocketChannelFactory(bossExecutor, workerExecutor));
    }
View Full Code Here

    private static DuplexTcpServerBootstrap startProtoServer(int port) {
        PeerInfo serverInfo = new PeerInfo("0.0.0.0", port);
        DuplexTcpServerBootstrap bootstrap = new DuplexTcpServerBootstrap(
                serverInfo,
                new NioServerSocketChannelFactory(
                        Executors.newCachedThreadPool(),
                        Executors.newCachedThreadPool())
        );
        bootstrap.setRpcServerCallExecutor(new ThreadPoolCallExecutor(10, 10));
        return bootstrap;
View Full Code Here

  }
 
  public static void bootServer() {
    // More terse code to setup the server
    ServerBootstrap bootstrap = new ServerBootstrap(
        new NioServerSocketChannelFactory(
            Executors.newCachedThreadPool(),
            Executors.newCachedThreadPool()));

    // Set up the pipeline factory.
    bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
View Full Code Here

 
  public static void bootServer() {
   
    // More terse code to setup the server
    ServerBootstrap bootstrap = new ServerBootstrap(
        new NioServerSocketChannelFactory(
            Executors.newCachedThreadPool(),
            Executors.newCachedThreadPool()));

    // Set up the pipeline factory.
    bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
View Full Code Here

  public Bootstrap createServerBootstrap()
  {
    // TODO The thread pools should be injected from spring.
    serverBootstrap = new ServerBootstrap(
        new NioServerSocketChannelFactory(Executors
            .newCachedThreadPool(new NamedThreadFactory(
                "TCP-Server-Boss")), Executors
            .newCachedThreadPool(new NamedThreadFactory(
                "TCP-Server-Worker"))));
View Full Code Here

  public Bootstrap createServerBootstrap()
  {
    // TODO The thread pools should be injected from spring.
    serverBootstrap = new ServerBootstrap(
       
        new NioServerSocketChannelFactory(Executors
            .newFixedThreadPool(1,new NamedThreadFactory(
                "Flash-Server-Boss")), Executors
            .newFixedThreadPool(1,new NamedThreadFactory(
                "Flash-Server-Worker"))));
View Full Code Here

  public static synchronized void startupNettyServer(int httpPort) {
    if (nettyStarted)
      return;
    nettyStarted = true;
    ServerBootstrap server = new ServerBootstrap(
        new NioServerSocketChannelFactory(
            Executors.newCachedThreadPool(),
            Executors.newCachedThreadPool()));

    server.setPipelineFactory(new CountandraHttpServerPipelineFactory());
    server.bind(new InetSocketAddress(httpPort));
View Full Code Here

        ThreadFactory bossFactory = new NettyRenameThreadFactory(name() + "-boss");
        ThreadFactory workerFactory = new NettyRenameThreadFactory(name() + "-worker");
       
        if (maxWorkers > 0) {
            factory = new NioServerSocketChannelFactory(Executors.newCachedThreadPool(bossFactory),
                Executors.newCachedThreadPool(workerFactory), maxWorkers);
        } else {
            factory = new NioServerSocketChannelFactory(Executors.newCachedThreadPool(bossFactory),
                Executors.newCachedThreadPool(workerFactory));
        }
       
        LOG.info("Create Netty Server " + name() + ", buffer_size: " + buffer_size + ", maxWorkers: " + maxWorkers);
       
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.