private static final InternalLogger logger =
InternalLoggerFactory.getInstance(SctpClientChannel.class);
private static SctpChannel newChannael() {
SctpChannel underlayingChannel;
try {
underlayingChannel = SctpChannel.open();
} catch (IOException e) {
throw new ChannelException("Failed to open a sctp channel.", e);
}
boolean success = false;
try {
underlayingChannel.configureBlocking(false);
success = true;
} catch (IOException e) {
throw new ChannelException("Failed to enter non-blocking mode.", e);
} finally {
if (!success) {
try {
underlayingChannel.close();
} catch (IOException e) {
if (logger.isWarnEnabled()) {
logger.warn(
"Failed to close a partially initialized socket.",
e);