Examples of NioServerSocketChannelFactory


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

    MetricCollector collector = MetricCollector.getInstance(5000);
    bossPool = ThreadPoolFactory.newCachedThreadPool(getClass().getPackage().getName(), "boss");
    workerPool =  ThreadPoolFactory.newCachedThreadPool(getClass().getPackage().getName(), "worker");
    pipelineFactory = new ServerPipelineFactory(getPipelineModifiers());
    ((ServerPipelineFactory)pipelineFactory).addModifier(collector.getName(), collector);
    channelFactory = new NioServerSocketChannelFactory(bossPool, workerPool);
    bstrap = new ServerBootstrap(channelFactory);
    bstrap.setPipelineFactory(pipelineFactory);
    bstrap.setOption("child.keepAlive", true);
    bstrap.bind(isock);
    LOG.info("Netty-Ajax Server Started with Root [" + contentRoot + "]");   
View Full Code Here

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

        //You need then to create a DuplexTcpServerBootstrap and provide it an RpcCallExecutor.


        DuplexTcpServerBootstrap bootstrap = new DuplexTcpServerBootstrap(
                serverInfo,
                new NioServerSocketChannelFactory(
                        Executors.newCachedThreadPool(),
                        Executors.newCachedThreadPool())
        );

        bootstrap.setRpcServerCallExecutor(new ThreadPoolCallExecutor(10, 10));
View Full Code Here

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

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

    }

    @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

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

        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

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())
        );
        bootstrap.setRpcServerCallExecutor(new ThreadPoolCallExecutor(10, 10));
        return bootstrap;
View Full Code Here

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

  }
 
  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

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

 
  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

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

  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

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

  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
TOP
Copyright © 2018 www.massapi.com. 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.