Package org.jboss.netty.channel

Examples of org.jboss.netty.channel.ChannelFactory


    this.password = password;
    this.executor = exec;

    this.proxySettings = proxy;

    final ChannelFactory channelFactory = new NioClientSocketChannelFactory(
        executor, executor);

    boot = new ClientBootstrap(channelFactory);

    if (proxySettings == null) {
View Full Code Here


    }
  }

  @Override
  public void start() {
    ChannelFactory factory = new NioServerSocketChannelFactory(
        Executors.newCachedThreadPool(), Executors.newCachedThreadPool());

    ServerBootstrap serverBootstrap = new ServerBootstrap(factory);
    serverBootstrap.setPipelineFactory(new ChannelPipelineFactory() {
      @Override
View Full Code Here

    }
  }

  @Override
  public void start() {
    ChannelFactory factory = new NioServerSocketChannelFactory(
        Executors.newCachedThreadPool(), Executors.newCachedThreadPool());

    ServerBootstrap serverBootstrap = new ServerBootstrap(factory);
    serverBootstrap.setPipelineFactory(new ChannelPipelineFactory() {
      @Override
View Full Code Here

    this.workerCount = workercount;
  }
 
  public void run() {
    // Configure the Server.
    ChannelFactory factory;
    if (workerCount == 0) {
      // Use default workers: 2 * the number of available processors
      factory = new NioServerSocketChannelFactory(
          Executors.newCachedThreadPool(), Executors.newCachedThreadPool());
    } else {
View Full Code Here

  /**
   * Initializes the server.
   */
  private void init() {
    /* initialize channel and pipeline factories */
    ChannelFactory factory = new NioServerSocketChannelFactory(executor, executor);
    bootstrap.setFactory(factory);

    ChannelPipelineFactory pipelineFactory = new MinecraftPipelineFactory(this);
    bootstrap.setPipelineFactory(pipelineFactory);

View Full Code Here

    public boolean start() {
        // Standard netty bootstrapping stuff.
        Executor bossPool = Executors.newCachedThreadPool();
        Executor workerPool = Executors.newCachedThreadPool();
        ChannelFactory factory =
                new NioClientSocketChannelFactory(bossPool, workerPool);
        this.bootstrap = new ClientBootstrap(factory);

        // Declared outside to fit under 80 char limit
        final DelimiterBasedFrameDecoder frameDecoder =
View Full Code Here

     *         if the factory is not set for this bootstrap yet.
     *         The factory can be set in the constructor or
     *         {@link #setFactory(ChannelFactory)}.
     */
    public ChannelFactory getFactory() {
        ChannelFactory factory = this.factory;
        if (factory == null) {
            throw new IllegalStateException(
                    "factory is not set yet.");
        }
        return factory;
View Full Code Here

            options.put(key, value);
        }
    }

    public void releaseExternalResources() {
        ChannelFactory factory = this.factory;
        if (factory != null) {
            factory.releaseExternalResources();
        }
    }
View Full Code Here

  public void init() {
    // Standard netty bootstrapping stuff.
    bossPool = Executors.newCachedThreadPool();
    workerPool = (ThreadPoolExecutor)Executors.newCachedThreadPool();
    ChannelFactory factory =
      new NioClientSocketChannelFactory(bossPool, workerPool);

    handler = new ClientHandler(listener);
    bootstrap = new ClientBootstrap(factory);
View Full Code Here

    }

    public boolean start() {
        bossPool = Executors.newCachedThreadPool();
        workerPool = (ThreadPoolExecutor)Executors.newCachedThreadPool();
        ChannelFactory factory = new NioServerSocketChannelFactory(bossPool, workerPool);
        allChannels = new DefaultChannelGroup("mupd8-server");

        bootstrap = new ServerBootstrap(factory);
        bootstrap.setOption("reuseAddress", true);
        bootstrap.setOption("child.tcpNoDelay", true);
View Full Code Here

TOP

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

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.