Examples of shutdownGracefully()


Examples of io.netty.channel.nio.NioEventLoopGroup.shutdownGracefully()

            if (lastWriteFuture != null) {
                lastWriteFuture.awaitUninterruptibly();
            }
        } finally {
            serverGroup.shutdownGracefully();
            clientGroup.shutdownGracefully();
        }
    }
}
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup.shutdownGracefully()

                        // remember folks, this is blocking.
                        log.info(String.format("Binding to %s", addr.toString()));
                        bootstrap.bind(addr).sync().channel().closeFuture().await();
                       
                    } finally {
                        group.shutdownGracefully();
                        running.set(false);
                    }
                } catch (Exception ex) {
                    running.set(false);
                    log.error(ex.getMessage(), ex);
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup.shutdownGracefully()

                    }
                }

                @Override
                public boolean cancel() {
                    group.shutdownGracefully();
                    return true;
                }
            };

            // set things in motion.
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup.shutdownGracefully()

      eventLoop = eventLoopGroup.get();
    } else {
      eventLoop = new NioEventLoopGroup(1);
      Runtime.getRuntime().addShutdownHook(new Thread() {
        public void run() {
          eventLoop.shutdownGracefully();
        }
      });
    }
    return eventLoop;
  }
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup.shutdownGracefully()

      @Override
      public void operationComplete(ChannelFuture channelFuture) throws Exception {
        channelFuture.channel().closeFuture().addListener(new ChannelFutureListener() {
          @Override
          public void operationComplete(ChannelFuture future) throws Exception {
            workerGroup.shutdownGracefully();
          }
        });

        if (channelFuture.isSuccess()) {
          channel = channelFuture.channel();
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup.shutdownGracefully()

      Channel ch = b.bind(fw.host, fw.port).sync().channel();
      ch.closeFuture().sync();
    } finally {
      bossGroup.shutdownGracefully();
      workerGroup.shutdownGracefully();
    }
  }


}
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup.shutdownGracefully()

      // shut down your server.
      f.channel().closeFuture().sync();
    } catch (InterruptedException ie) {
      LOGGER.error("Server interrupted: ", ie);
    } finally {
      workerGroup.shutdownGracefully();
      bossGroup.shutdownGracefully();
    }
  }
}
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup.shutdownGracefully()

          catch (Exception e) {
            throw new RuntimeException(e);
          }
          finally {
            bossGroup.shutdownGracefully();
            workerGroup.shutdownGracefully();
          }
        }
      });

    } catch (Throwable t) {
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup.shutdownGracefully()

            // Wait until the connection is closed.
            channel.close().syncUninterruptibly();
        } finally {
            if (workerGroup != null) {
                workerGroup.shutdownGracefully();
            }
        }
    }
}
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup.shutdownGracefully()

            System.err.println("If using Chrome browser, check your SPDY sessions at chrome://net-internals/#spdy");

            ch.closeFuture().sync();
        } finally {
            bossGroup.shutdownGracefully();
            workerGroup.shutdownGracefully();
        }
    }
}
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.