Examples of NioServerSocketChannelFactory


Examples of io.netty.channel.socket.nio.NioServerSocketChannelFactory

  public void start() {
    int port = ErraiConfigAttribs.WEB_SOCKET_PORT.getInt(svc.getConfiguration());

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

    final WebSocketServerPipelineFactory factory = new WebSocketServerPipelineFactory(svc);

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

Examples of org.elasticsearch.common.netty.channel.socket.nio.NioServerSocketChannelFactory

            message.writeByte((byte) i);
        }

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

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

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

       
        if (maxWorkers == 0) {
          maxWorkers = Runtime.getRuntime().availableProcessors();
        }
   
        ChannelFactory factory = new NioServerSocketChannelFactory(this.nettyPool, this.nettyPool, maxWorkers);
       
        ServerBootstrap bootstrap = new ServerBootstrap(factory);
        this.channelHandler = createChannelPipelineFactory(config, storageManager);
        bootstrap.setPipelineFactory(channelHandler);
        if (inputBufferSize != 0) {
View Full Code Here

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

    public synchronized NettyWebServer start() {
        ExecutorService exec1 = Executors.newSingleThreadExecutor();
        executorServices.add(exec1);
        ExecutorService exec2 = Executors.newSingleThreadExecutor();
        executorServices.add(exec2);
        bootstrap.setFactory(new NioServerSocketChannelFactory(exec1, exec2, 1));
        channel = bootstrap.bind(socketAddress);
        return this;
    }
View Full Code Here

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

public class FactorialServer {

    public static void main(String[] args) throws Exception {
        // Configure the server.
        ServerBootstrap bootstrap = new ServerBootstrap(
                new NioServerSocketChannelFactory(
                        Executors.newCachedThreadPool(),
                        Executors.newCachedThreadPool()));

        // Set up the event pipeline factory.
        bootstrap.setPipelineFactory(new FactorialServerPipelineFactory());
View Full Code Here

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

    {
        Executor executor = Executors.newFixedThreadPool(200);

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

        bootstrap.setPipelineFactory(
               new RPCServerSessionPipelineFactory( new RPCServerMixinPipelineFactory(executor)));
View Full Code Here

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

  public AHessianJmxServer(MBeanServer mbeanServer, String ipFilter, String serviceDiscoveryName, int port, Logger log)
  {
    Executor executor = Executors.newFixedThreadPool(10);

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

    bootstrap
        .setPipelineFactory(new AHessianServerPipelineFactory(executor, new IpFilterRuleHandler(new IpFilterRuleList(ipFilter)), mbeanServer, log));

    int serverPort = port;
View Full Code Here

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

  public static void main(String[] args)
  {
    int port = Integer.parseInt(args[0]);
   
    ChannelFactory factory =
            new NioServerSocketChannelFactory(
                    Executors.newCachedThreadPool(),
                    Executors.newCachedThreadPool());

        ServerBootstrap bootstrap = new ServerBootstrap(factory);
       
View Full Code Here

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

    if(maxThreads <= 0) {
      server = new NettyServer(responder,
              new InetSocketAddress(bindAddress, port));
    } else {
      server = new NettyServer(responder, new InetSocketAddress(bindAddress, port),
              new NioServerSocketChannelFactory(
                      Executors.newCachedThreadPool(),
                      Executors.newFixedThreadPool(maxThreads)));
    }
    connectionCountUpdater = Executors.newSingleThreadScheduledExecutor();
    server.start();
View Full Code Here

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

    /**
     * {@inheritDoc}
     */
    public void start(int port) throws IOException {
        factory = new NioServerSocketChannelFactory();
        ServerBootstrap bootstrap = new ServerBootstrap(factory);
        bootstrap.setOption("receiveBufferSize", 128 * 1024);
        bootstrap.setOption("tcpNoDelay", true);
        bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
            public ChannelPipeline getPipeline() throws Exception {
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.