Examples of NioDatagramChannelFactory


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

    protected void setupUDPCommunication() throws Exception {
        if (datagramChannelFactory == null) {
            workerExecutor = context.getExecutorServiceManager().newCachedThreadPool(this, "NettyUDPWorker");
            if (configuration.getWorkerCount() <= 0) {
                datagramChannelFactory = new NioDatagramChannelFactory(workerExecutor);
            } else {
                datagramChannelFactory = new NioDatagramChannelFactory(workerExecutor, configuration.getWorkerCount());
            }
        }
    }
View Full Code Here

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

    }

    private void initializeUDPServerSocketCommunicationLayer() throws Exception {
        workerExecutor = context.getExecutorServiceManager().newCachedThreadPool(this, "NettyUDPWorker");
        if (configuration.getWorkerCount() <= 0) {
            datagramChannelFactory = new NioDatagramChannelFactory(workerExecutor);
        } else {
            datagramChannelFactory = new NioDatagramChannelFactory(workerExecutor, configuration.getWorkerCount());
        }
        connectionlessServerBootstrap = new ConnectionlessBootstrap(datagramChannelFactory);
        connectionlessServerBootstrap.setOption("child.keepAlive", configuration.isKeepAlive());
        connectionlessServerBootstrap.setOption("child.tcpNoDelay", configuration.isTcpNoDelay());
        connectionlessServerBootstrap.setOption("reuseAddress", configuration.isReuseAddress());
View Full Code Here

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

    this.workerCount = workerCount;
  }

  public void run() {
    // Configure the client.
    DatagramChannelFactory f = new NioDatagramChannelFactory(
        Executors.newCachedThreadPool(), workerCount);

    ConnectionlessBootstrap b = new ConnectionlessBootstrap(f);
    b.setPipeline(Channels.pipeline(
            RpcUtil.STAGE_RPC_MESSAGE_PARSER, rpcProgram,
View Full Code Here

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

            RpcUtil.STAGE_RPC_MESSAGE_PARSER, idleStateHandler, handler,
            RpcUtil.STAGE_RPC_TCP_RESPONSE);
      }
    });

    udpServer = new ConnectionlessBootstrap(new NioDatagramChannelFactory(
        Executors.newCachedThreadPool()));

    udpServer.setPipeline(Channels.pipeline(RpcUtil.STAGE_RPC_MESSAGE_PARSER,
        handler, RpcUtil.STAGE_RPC_UDP_RESPONSE));
View Full Code Here

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

    protected void setupUDPCommunication() throws Exception {
        if (datagramChannelFactory == null) {
            int count = configuration.getWorkerCount() > 0 ? configuration.getWorkerCount() : NettyHelper.DEFAULT_IO_THREADS;
            workerPool = new NioDatagramWorkerPool(Executors.newCachedThreadPool(), count);
            datagramChannelFactory = new NioDatagramChannelFactory(workerPool);
        }
    }
View Full Code Here

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

    protected void startServerBootstrap() throws Exception {
        // create non-shared worker pool
        int count = configuration.getWorkerCount() > 0 ? configuration.getWorkerCount() : NettyHelper.DEFAULT_IO_THREADS;
        workerPool = new NioDatagramWorkerPool(Executors.newCachedThreadPool(), count);

        datagramChannelFactory = new NioDatagramChannelFactory(workerPool);

        connectionlessBootstrap = new ConnectionlessBootstrap(datagramChannelFactory);
        connectionlessBootstrap.setOption("child.keepAlive", configuration.isKeepAlive());
        connectionlessBootstrap.setOption("child.tcpNoDelay", configuration.isTcpNoDelay());
        connectionlessBootstrap.setOption("reuseAddress", configuration.isReuseAddress());
View Full Code Here

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

    }

    private void initializeUDPServerSocketCommunicationLayer() throws Exception {
        workerExecutor = context.getExecutorServiceManager().newCachedThreadPool(this, "NettyUDPWorker");
        if (configuration.getWorkerCount() <= 0) {
            datagramChannelFactory = new NioDatagramChannelFactory(workerExecutor);
        } else {
            datagramChannelFactory = new NioDatagramChannelFactory(workerExecutor, configuration.getWorkerCount());
        }
        connectionlessServerBootstrap = new ConnectionlessBootstrap(datagramChannelFactory);
        connectionlessServerBootstrap.setOption("child.keepAlive", configuration.isKeepAlive());
        connectionlessServerBootstrap.setOption("child.tcpNoDelay", configuration.isTcpNoDelay());
        connectionlessServerBootstrap.setOption("reuseAddress", configuration.isReuseAddress());
View Full Code Here

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

    private void initializeUDPServerSocketCommunicationLayer() throws Exception {
        ExecutorService workerExecutor = context.getExecutorServiceManager().newThreadPool(this, "NettyUDPWorker",
                configuration.getCorePoolSize(), configuration.getMaxPoolSize());

        datagramChannelFactory = new NioDatagramChannelFactory(workerExecutor);
        connectionlessServerBootstrap = new ConnectionlessBootstrap(datagramChannelFactory);
        if (configuration.getServerPipelineFactory() != null) {
            configuration.getServerPipelineFactory().setConsumer(this);
            connectionlessServerBootstrap.setPipelineFactory(configuration.getServerPipelineFactory());
        } else {
View Full Code Here

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

    protected void setupUDPCommunication() throws Exception {
        if (datagramChannelFactory == null) {
            ExecutorService workerExecutor = context.getExecutorServiceManager().newThreadPool(this, "NettyUDPWorker",
                    configuration.getCorePoolSize(), configuration.getMaxPoolSize());
            datagramChannelFactory = new NioDatagramChannelFactory(workerExecutor);
        }
    }
View Full Code Here

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

@Ignore
public class NioNioDatagramMulticastTest extends AbstractDatagramMulticastTest {

    @Override
    protected DatagramChannelFactory newServerSocketChannelFactory(Executor executor) {
        return new NioDatagramChannelFactory(executor, InternetProtocolFamily.IPv4);
    }
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.