final StreamSinkChannel requestChannel = connection.getSinkChannel();
requestChannel.shutdownWrites();
// will return false if there's a response queued ahead of this one, so we'll set up a listener then
if (!requestChannel.flush()) {
requestChannel.getWriteSetter().set(ChannelListeners.flushingChannelListener(null, null));
requestChannel.resumeWrites();
}
// Cancel the current active request
currentRequest.setFailed(new IOException(MESSAGES.connectionClosed()));
} catch (IOException e) {
if (UndertowLogger.CLIENT_LOGGER.isDebugEnabled()) {