public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
super.channelClosed(ctx, e);
if (failOnMissingResponse) {
long missingResponses = requestResponseCounter.get();
if (missingResponses > 0) {
throw new PrematureChannelClosureException(
"Channel closed but still missing " + missingResponses + " response(s)");
}
}
}