Package org.jboss.netty.channel

Examples of org.jboss.netty.channel.FixedReceiveBufferSizePredictorFactory


     */
    public void start(final int port, final CountDownLatch counter, final byte[] data) throws IOException {
        factory = new NioDatagramChannelFactory();
        ConnectionlessBootstrap bootstrap = new ConnectionlessBootstrap(factory);
        bootstrap.setOption("sendBufferSize", 65536);
        bootstrap.setOption("receiveBufferSizePredictorFactory", new FixedReceiveBufferSizePredictorFactory(9000));
        bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
            public ChannelPipeline getPipeline() throws Exception {
                return Channels.pipeline(new SimpleChannelUpstreamHandler() {
                    private void sendMessage(ChannelHandlerContext ctx, byte[] data) {
                        ChannelBuffer buffer = ChannelBuffers.wrappedBuffer(data);
View Full Code Here


    @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

        connectionlessBootstrap.setOption("sendBufferSize", configuration.getSendBufferSize());
        connectionlessBootstrap.setOption("receiveBufferSize", configuration.getReceiveBufferSize());
        // only set this if user has specified
        if (configuration.getReceiveBufferSizePredictor() > 0) {
            connectionlessBootstrap.setOption("receiveBufferSizePredictorFactory",
                    new FixedReceiveBufferSizePredictorFactory(configuration.getReceiveBufferSizePredictor()));
        }
        if (configuration.getBacklog() > 0) {
            connectionlessBootstrap.setOption("backlog", configuration.getBacklog());
        }
View Full Code Here

    @Override
    public Bootstrap getBootstrap() {
        final ConnectionlessBootstrap bootstrap =
                new ConnectionlessBootstrap(new NioDatagramChannelFactory(workerExecutor));

        bootstrap.setOption("receiveBufferSizePredictorFactory", new FixedReceiveBufferSizePredictorFactory(8192));
        bootstrap.setOption("receiveBufferSize", getRecvBufferSize());

        return bootstrap;
    }
View Full Code Here

        connectionlessServerBootstrap.setOption("sendBufferSize", configuration.getSendBufferSize());
        connectionlessServerBootstrap.setOption("receiveBufferSize", configuration.getReceiveBufferSize());
        // only set this if user has specified
        if (configuration.getReceiveBufferSizePredictor() > 0) {
            connectionlessServerBootstrap.setOption("receiveBufferSizePredictorFactory",
                new FixedReceiveBufferSizePredictorFactory(configuration.getReceiveBufferSizePredictor()));
        }

        channel = connectionlessServerBootstrap.bind(new InetSocketAddress(configuration.getHost(), configuration.getPort()));
        // to keep track of all channels in use
        allChannels.add(channel);
View Full Code Here

        connectionlessServerBootstrap.setOption("sendBufferSize", configuration.getSendBufferSize());
        connectionlessServerBootstrap.setOption("receiveBufferSize", configuration.getReceiveBufferSize());
        // only set this if user has specified
        if (configuration.getReceiveBufferSizePredictor() > 0) {
            connectionlessServerBootstrap.setOption("receiveBufferSizePredictorFactory",
                new FixedReceiveBufferSizePredictorFactory(configuration.getReceiveBufferSizePredictor()));
        }

        // must get the pipeline from the factory when opening a new connection
        ChannelPipeline serverPipeline = pipelineFactory.getPipeline(this);
        connectionlessServerBootstrap.setPipeline(serverPipeline);
View Full Code Here

    boot.setPipelineFactory(pipelineFactory);

    boot.setOption("broadcast", "false");
    boot.setOption("receiveBufferSizePredictorFactory", //
        new FixedReceiveBufferSizePredictorFactory(2 * 1024));

  }
 
View Full Code Here

    boot.setPipelineFactory(pipelineFactory);

    boot.setOption("broadcast", "false");
    boot.setOption("receiveBufferSizePredictorFactory", //
        new FixedReceiveBufferSizePredictorFactory(2 * 1024));

  }
 
View Full Code Here

    boot.setPipelineFactory(pipelineFactory);

    boot.setOption("broadcast", "false");
    boot.setOption("receiveBufferSizePredictorFactory", //
        new FixedReceiveBufferSizePredictorFactory(2 * 1024));

  }
 
View Full Code Here

    boot.setPipelineFactory(pipelineFactory);

    boot.setOption("broadcast", "false");
    boot.setOption("receiveBufferSizePredictorFactory", //
        new FixedReceiveBufferSizePredictorFactory(2 * 1024));

  }
 
View Full Code Here

TOP

Related Classes of org.jboss.netty.channel.FixedReceiveBufferSizePredictorFactory

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.