Package org.jboss.netty.bootstrap

Examples of org.jboss.netty.bootstrap.ServerBootstrap.bind()


        bootstrap.setOption("child.tcpNoDelay", true);
        bootstrap.setOption("child.keepAlive", true);
        bootstrap.setOption("reuseAddress", true);

        // Bind and start to accept incoming connections.
        allChannels.add(bootstrap.bind(isSSLEnabled ? new InetSocketAddress(conf.getSSLServerPort())
                                       : new InetSocketAddress(conf.getServerPort())));
        logger.info("Going into receive loop");
    }

    public void shutdown() {
View Full Code Here


        }
        p.addLast("handler", new NettyServerAvroHandler());
        return p;
      }
    });
    serverChannel = bootstrap.bind(addr);
    allChannels.add(serverChannel);
  }

  /**
   * @param executionHandler if not null, will be inserted into the Netty
View Full Code Here

              }
              p.addLast("handler", new NettyServerAvroHandler());
              return p;
          }
      });
      serverChannel = bootstrap.bind(addr);
      allChannels.add(serverChannel);
  }
   
  @Override
  public void start() {
View Full Code Here

        p.addLast("handler", new NettyServerWaspHandler());
        return p;
      }
    });
    this.addr = addr;
    serverChannel = bootstrap.bind(addr);
    allChannels.add(serverChannel);
  }

  public static InetSocketAddress getRemoteAddress() {
    return thread2Address.get(Thread.currentThread());
View Full Code Here

      // Bind and start to accept incoming connections.
      bootstrap.setOption("child.tcpNoDelay", tcpNoDelay);
      if (sendBufSize > 0) bootstrap.setOption("child.sendBufferSize", sendBufSize);
      if (recvBufSize > 0) bootstrap.setOption("child.receiveBufferSize", recvBufSize);

      bootstrap.bind(address);
   }

   @Override
   public void stop() {
      if (channel != null) channel.close();
View Full Code Here

    // Try to bind to a port.  If the port is 0, netty will select a port.
    int bindAttempt = 0;
    while (bindAttempt < DEFAULT_BIND_ATTEMPT_MAX) {
      try {
        InetSocketAddress address = new InetSocketAddress(port);
        Channel ch = bootstrap.bind(address);
        accepted.add(ch);
        port = ((InetSocketAddress) ch.getLocalAddress()).getPort();
        break;
      } catch (ChannelException e) {
        LOG.warn("start: Likely failed to bind on attempt " +
View Full Code Here

      throw new RuntimeException(ex);
    }
    bootstrap.setPipelineFactory(pipelineFact);
    port = conf.getInt(ConfVars.PULLSERVER_PORT.varname,
        ConfVars.PULLSERVER_PORT.defaultIntVal);
    Channel ch = bootstrap.bind(new InetSocketAddress(port));
    accepted.add(ch);
    port = ((InetSocketAddress)ch.getLocalAddress()).getPort();
    conf.set(ConfVars.PULLSERVER_PORT.varname, Integer.toString(port));
    pipelineFact.PullServer.setPort(port);
    LOG.info(getName() + " listening on port " + port);
View Full Code Here

      throw new RuntimeException(ex);
    }
    bootstrap.setPipelineFactory(pipelineFact);
    port = conf.getInt(ConfVars.PULLSERVER_PORT.varname,
        ConfVars.PULLSERVER_PORT.defaultIntVal);
    Channel ch = bootstrap.bind(new InetSocketAddress(port));
    accepted.add(ch);
    port = ((InetSocketAddress)ch.getLocalAddress()).getPort();
    conf.set(ConfVars.PULLSERVER_PORT.varname, Integer.toString(port));
    pipelineFact.PullServer.setPort(port);
    LOG.info(getName() + " listening on port " + port);
View Full Code Here

        return Channels.pipeline(new HttpRequestDecoder(),
            new HttpChunkAggregator(65536), new HttpResponseEncoder(),
            new CredentialsLogicHandler(token, url.toString()));
      }
    });
    bootstrap.bind(new InetSocketAddress("localhost", port));
    return bootstrap;
  }
 
}
View Full Code Here

    } catch (Exception ex) {
      throw new RuntimeException(ex);
    }
    bootstrap.setPipelineFactory(pipelineFact);
    port = conf.getInt(SHUFFLE_PORT_CONFIG_KEY, DEFAULT_SHUFFLE_PORT);
    Channel ch = bootstrap.bind(new InetSocketAddress(port));
    accepted.add(ch);
    port = ((InetSocketAddress)ch.getLocalAddress()).getPort();
    conf.set(SHUFFLE_PORT_CONFIG_KEY, Integer.toString(port));
    pipelineFact.SHUFFLE.setPort(port);
    LOG.info(getName() + " listening on port " + port);
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.