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

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


        configureThreadPool(getWorkerExecutorName(), workerExecutor);

        if (receiveExecutor != null)
            configureThreadPool(getReceiveExecutorName(), receiveExecutor);

        this.channelFactory = isSendToServerInsteadOfMulticast() ? new NioDatagramChannelFactory(workerExecutor) : new OioDatagramChannelFactory(workerExecutor);
        this.bootstrap = new ConnectionlessBootstrap(channelFactory);
        this.bootstrap.setOption("receiveBufferSizePredictorFactory", new FixedReceiveBufferSizePredictorFactory(4096));

        bootstrap.setPipelineFactory(new UdpMessagePipelineFactory(LOG, new ChannelNodeAddressResolver(addressResolver), receiveExecutor) {
View Full Code Here


            @ChannelFactoryResource Executor executor) {
        super(executor);
    }

    public NioDatagramChannelFactory get() {
        return new NioDatagramChannelFactory(executor);
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void start(int port) throws IOException {
        factory = new NioDatagramChannelFactory();
        ConnectionlessBootstrap bootstrap = new ConnectionlessBootstrap(factory);
        bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
            public ChannelPipeline getPipeline() throws Exception {
                return Channels.pipeline(new SimpleChannelUpstreamHandler() {
                    @Override
View Full Code Here

                LocalServerChannelFactory.class);

        // Miscellaneous transports
        register(ctx, new OioClientSocketChannelFactory(executor));
        register(ctx, new OioServerSocketChannelFactory(executor, executor));
        register(ctx, new NioDatagramChannelFactory(executor));
    }
View Full Code Here

        return channelFactory;
    }
   
    public static DatagramChannelFactory getDatagramFactory() {
        if (datagramChannelFactory == null) {
            datagramChannelFactory = new NioDatagramChannelFactory();
        }
        return datagramChannelFactory;
    }
View Full Code Here

    @Inject
    private NetworkChannel(NetworkSettings settings, Provider<MessageHandler> handler) {
        this.handler = handler;

        bootstrap = new ClientBootstrap(new NioDatagramChannelFactory(
                Executors.newSingleThreadExecutor()));
        bootstrap.setPipelineFactory(pipelineFactory);

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

    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

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

    private void initializeUDPServerSocketCommunicationLayer() throws Exception {
        ExecutorService workerExecutor = context.getExecutorServiceStrategy().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

    }

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

TOP

Related Classes of org.jboss.netty.channel.socket.nio.NioDatagramChannelFactory

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.