static void closeOnFlush(Channel ch) {
    if (ch.isActive()) {
      ch.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
    }
  }
Closes the specified channel after all queued write requests are flushed.
zipkin-collector/scribe/src/main/java/zipkin2/collector/scribe/ScribeInboundHandler.java