Examples of NioEventLoopGroup


Examples of io.netty.channel.nio.NioEventLoopGroup

    private int receivedCount;
    private EventLoopGroup group;
    private Bootstrap bootstrap;

    public void createNettyUdpReceiver() {
        group = new NioEventLoopGroup();
        bootstrap = new Bootstrap();
        bootstrap.group(group)
                .channel(NioDatagramChannel.class)
                .handler(new ChannelInitializer<Channel>() {
                    @Override
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup

    private int receivedCount;
    private EventLoopGroup group;
    private Bootstrap bootstrap;

    public void createNettyUdpReceiver() {
        group = new NioEventLoopGroup();
        bootstrap = new Bootstrap();
        bootstrap.group(group)
                .channel(NioDatagramChannel.class)
                .handler(new ChannelInitializer<Channel>() {
                    @Override
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup

         group = SharedNioEventLoopGroup.getInstance(threadsToUse);
      }
      else
      {
         channelClazz = NioSocketChannel.class;
         group = new NioEventLoopGroup(threadsToUse);
      }
      // if we are a servlet wrap the socketChannelFactory
      if (useServlet)
      {
         // TODO: This will be replaced by allow upgrade HTTP connection from Undertow.;
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup

        if (port == null && securePort == null) {
            throw new IllegalStateException("You must specify a port or a secure port");
        }

        hasStarted = SettableFuture.create();
        bossGroup = new NioEventLoopGroup();
        workerGroup = new NioEventLoopGroup();

        Thread mockServerThread = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup

    @PostConstruct
    public void startServer() throws InterruptedException {
        if (serverBootstrap == null) {
            try {
                serverBootstrap = new ServerBootstrap()
                        .group(new NioEventLoopGroup(1), new NioEventLoopGroup(1))
                        .channel(NioServerSocketChannel.class)
                        .childHandler(new ChannelInitializer<SocketChannel>() {
                            @Override
                            public void initChannel(SocketChannel ch) throws Exception {
                                ChannelPipeline pipeline = ch.pipeline();
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup

         else
         {
            threadsToUse = this.nioRemotingThreads;
         }
         channelClazz = NioServerSocketChannel.class;
         eventLoopGroup = new NioEventLoopGroup(threadsToUse, new HornetQThreadFactory("hornetq-netty-threads", true, getThisClassLoader()));
      }

      bootstrap = new ServerBootstrap();
      bootstrap.group(eventLoopGroup);
      bootstrap.channel(channelClazz);
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup

         else
         {
            threadsToUse = this.nioRemotingThreads;
         }
         channelClazz = NioServerSocketChannel.class;
         eventLoopGroup = new NioEventLoopGroup(threadsToUse, new HornetQThreadFactory("hornetq-netty-threads", true, getThisClassLoader()));
      }

      bootstrap = new ServerBootstrap();
      bootstrap.group(eventLoopGroup);
      bootstrap.channel(channelClazz);
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup

        this.logger.info("Bootstrapping server");

        this.serverBootstrap = new ServerBootstrap();

        this.boss = new NioEventLoopGroup();
        this.worker = new NioEventLoopGroup();

        this.serverBootstrap.group(this.boss, this.worker)
                .channel(NioServerSocketChannel.class)
                .localAddress(new InetSocketAddress(this.serverEnvironment.getAddress(), this.serverEnvironment.getPort()))
                .childHandler(new ServerInitializer(this.serverEnvironment));
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup

    static class Factory {
        private final EventLoopGroup group;

        public Factory(final int nioPoolSize) {
            final BasicThreadFactory threadFactory = new BasicThreadFactory.Builder().namingPattern("gremlin-driver-nio-%d").build();
            group = new NioEventLoopGroup(nioPoolSize, threadFactory);
        }
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup

     * {@inheritedDoc}
     */
    public void start(final int port, final CountDownLatch counter, final byte[] data) throws IOException {
        bootstrap = new Bootstrap();
        bootstrap.option(ChannelOption.SO_SNDBUF, 65536);
        bootstrap.group(new NioEventLoopGroup());
        bootstrap.channel(NioDatagramChannel.class);
        bootstrap.handler(new ChannelInitializer<DatagramChannel>() {

            @Override
            protected void initChannel(DatagramChannel ch) throws Exception {
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.