Examples of NioServerSocketChannelFactory


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

        new Thread(tg, new Runnable() {
            @Override
            public void run() {
                client = new HedwigClient(cfg);

                serverSocketChannelFactory = new NioServerSocketChannelFactory(Executors.newCachedThreadPool(),
                        Executors.newCachedThreadPool());
                initializeHandlers();
                initializeNetty();

                queue.offer(true);
View Full Code Here

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

            public void run() {
                try {
                    // Since zk is needed by almost everyone,try to see if we
                    // need that first
                    scheduler = Executors.newSingleThreadScheduledExecutor();
                    serverChannelFactory = new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors
                            .newCachedThreadPool());
                    clientChannelFactory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors
                            .newCachedThreadPool());

                    instantiateZookeeperClient();
View Full Code Here

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

  private final ChannelFactory channelFactory;
  private final CountDownLatch closed = new CountDownLatch(1);
  private final ExecutionHandler executionHandler;           
 
  public NettyServer(Responder responder, InetSocketAddress addr) {
    this(responder, addr, new NioServerSocketChannelFactory
         (Executors .newCachedThreadPool(), Executors.newCachedThreadPool()));
  }
View Full Code Here

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

  private final ChannelFactory channelFactory;
  private final CountDownLatch closed = new CountDownLatch(1);
  private final ExecutionHandler executionHandler;           
 
  public NettyServer(Responder responder, InetSocketAddress addr) {
    this(responder, addr, new NioServerSocketChannelFactory
         (Executors .newCachedThreadPool(), Executors.newCachedThreadPool()));
  }
View Full Code Here

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

        return startServer(new PipelineFactory(handlers));
    }

    private int startServer(ChannelPipelineFactory factory) {
        ServerBootstrap bootstrap = new ServerBootstrap(
                new NioServerSocketChannelFactory(
                        Executors.newCachedThreadPool(),
                        Executors.newCachedThreadPool()));

        bootstrap.setPipelineFactory(factory);
View Full Code Here

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

    @Override
    protected void startInner() {
        initialize();
        // Configure the service
        this.workerPool = (ThreadPoolExecutor) Executors.newCachedThreadPool();
        this.bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), workerPool));
        this.bootstrap.setOption("backlog", this.coordinatorConfig.getNettyServerBacklog());
        this.bootstrap.setOption("child.tcpNoDelay", true);
        this.bootstrap.setOption("child.keepAlive", true);
        this.bootstrap.setOption("child.reuseAddress", true);
View Full Code Here

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

    public TCPListener(Assignment assignment, @Named("s4.comm.timeout") int timeout) {
        // wait for an assignment
        node = assignment.assignClusterNode();
        nettyTimeout = timeout;

        ChannelFactory factory = new NioServerSocketChannelFactory(Executors.newCachedThreadPool(),
                Executors.newCachedThreadPool());

        bootstrap = new ServerBootstrap(factory);

        bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
View Full Code Here

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

    @PostConstruct
    public void start() {
        logger.info("Starting server.");
        // Configure the server.
        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

//        bootstrap = new ServerBootstrap(
//                new NioServerSocketChannelFactory(bossExec, ioExec, Runtime.getRuntime().availableProcessors() + 1));

        // Configure the server.
        bootstrap = new ServerBootstrap(
                new NioServerSocketChannelFactory(
                        Executors.newCachedThreadPool(),
                        Executors.newCachedThreadPool()));

        bootstrap.setOption("child.tcpNoDelay", true);
        bootstrap.setOption("child.keepAlive", true);
View Full Code Here

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

        workerExecutor = newFixedThreadPool(workerThreads, new ThreadFactoryBuilder().setNameFormat("thrift-worker-%s").build());

        acceptorExecutor = newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat("thrift-acceptor-%s").build());
        ioExecutor = newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat("thrift-io-%s").build());

        serverChannelFactory = new NioServerSocketChannelFactory(acceptorExecutor, ioExecutor);

        ThriftServerDef thriftServerDef = ThriftServerDef.newBuilder()
                                                         .name("thrift")
                                                         .listen(configuredPort)
                                                         .limitFrameSizeTo((int) config.getMaxFrameSize().toBytes())
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.