title: Netty lags for a few seconds before shutting down
body: <p>Iv been doing network programming for a while and recently converted one of my projects to netty.  Iv been bothered a lot by the fact that unlike with my original program, the client will freeze for about 3-5 seconds before closing, enough to make me end up force terminating it everytime because I don't want to wait for it.  Is this normal for netty? am I doing something wrong? </p>
  
  <p>main method:</p>
  
  <pre><code>public static void main(String[] args) throws Exception {
      final SslContext sslCtx = SslContext.newClientContext(InsecureTrustManagerFactory.INSTANCE);
  
      EventLoopGroup group = new NioEventLoopGroup();
      try {
          Bootstrap b = new Bootstrap();
          b.group(group)
           .channel(NioSocketChannel.class)
           .handler(new NetworkInitializer(sslCtx));
          // Start the connection attempt.
           ch = b.connect(HOST, PORT).sync().channel();
  
          //sends the clients name to the server
          askname();
  
  
      //loop just does some simple gl stuff and gameplay updating, posted below
          while(running){loop();
          if (Display.isCloseRequested()){
  
  
              running = false;
              if (lastWriteFuture != null) {
                  lastWriteFuture.sync();
              }    //tells the server to shut down
              write("9");
              ch.closeFuture().sync();
              group.shutdownGracefully();
              System.out.println("herro der");
              break;
          }
          }
      } finally {
          group.shutdownGracefully();
  
          // The connection is closed automatically on shutdown.
      }
  }
  </code></pre>
  
  <p>loop class:</p>
  
  <pre><code>    private static void loop() {
      GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
      //main update method for my game.  does calculations and stuff.  I can post it if neccisary but its kinda big.
      SpaceState.update();
      Display.update();
      Display.sync(60);
  }
  </code></pre>