use of org.apache.hc.core5.io.CloseMode in project httpcomponents-core by apache.
the class AbstractHttp1StreamDuplexer method shutdownSession.
void shutdownSession(final Exception cause) {
connState = ConnectionState.SHUTDOWN;
try {
terminate(cause);
} finally {
final CloseMode closeMode;
if (cause instanceof ConnectionClosedException) {
closeMode = CloseMode.GRACEFUL;
} else if (cause instanceof IOException) {
closeMode = CloseMode.IMMEDIATE;
} else {
closeMode = CloseMode.GRACEFUL;
}
ioSession.close(closeMode);
}
}
Aggregations