title: netty maintain connections and how to notify fail to channelfuture
body: <p>I am try to create a while loop in client that trying to maintain a number of connections to server.
  When a channel handler got certain response (error) from server, it should close the channel and mark this channel future failed. </p>
  
  <pre><code>Channel channel = this.channelPool.acquire().syncUninterruptibly().getNow();
  // release channel when closed to unblock creating new channel.
  channel.closeFuture().addListener((ChannelFutureListener) future -&gt; {
      // not success wait and retry
      if(!future.isSuccess()){
           trySleep();
      }
      // close normally, no error, release so can create another connection immediately
      this.channelPool.release(future.channel());
  });
  </code></pre>
  
  <p>There are two questions here</p>
  
  <ol>
  <li>is it the proper way to use while loop and FixedChannelPool to maintain number of connections from client to server?</li>
  <li>How to make the channelFuture fail? CloseFuture class always set success when setClosed() is called
  <a href="https://github.com/netty/netty/blob/4.1/transport/src/main/java/io/netty/channel/AbstractChannel.java#L1159" rel="nofollow noreferrer">https://github.com/netty/netty/blob/4.1/transport/src/main/java/io/netty/channel/AbstractChannel.java#L1159</a></li>
  </ol>
  
  <p>this example is a good way to keep one connection. but it requires singleton which is I want to avoid.
  Thanks!</p>