@SuppressWarnings("unchecked")
final
T conn = (T) session.getAttribute(IOEventDispatch.CONNECTION_KEY);
try {
ensureNotNull(conn);
final SSLIOSession ssliosession = (SSLIOSession) session.getAttribute(
SSLIOSession.SESSION_KEY);
if (ssliosession == null) {
onOutputReady(conn);
} else {
try {
if (!ssliosession.isInitialized()) {
ssliosession.initialize();
}
if (ssliosession.isAppOutputReady()) {
onOutputReady(conn);
}
ssliosession.outboundTransport();
} catch (final IOException ex) {
onException(conn, ex);
ssliosession.shutdown();
}
}
} catch (final RuntimeException ex) {
session.shutdown();
throw ex;