public ChannelFuture handshake() { ... if (exception == null) { // Began handshake successfully. try { final ChannelFuture hsFuture = handshakeFuture; wrapNonAppData(ctx, channel).addListener(new ChannelFutureListener() { public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { Throwable cause = future.getCause(); hsFuture.setFailure(cause); fireExceptionCaught(ctx, cause); if (closeOnSSLException) { Channels.close(ctx, future(channel)); } } else { hsFuture.setSuccess(); } } }); } catch (SSLException e) {
private void unbindAddress( SctpClientChannel channel, ChannelFuture future, InetAddress localAddress) { try { channel.channel.unbindAddress(localAddress); future.setSuccess(); } catch (Throwable t) { future.setFailure(t); fireExceptionCaught(channel, t); } }
private void bindAddress( SctpServerChannelImpl channel, ChannelFuture future, InetAddress localAddress) { try { channel.serverChannel.bindAddress(localAddress); future.setSuccess(); } catch (Throwable t) { future.setFailure(t); fireExceptionCaught(channel, t); } }
private void unbindAddress( SctpServerChannelImpl channel, ChannelFuture future, InetAddress localAddress) { try { channel.serverChannel.unbindAddress(localAddress); future.setSuccess(); } catch (Throwable t) { future.setFailure(t); fireExceptionCaught(channel, t); } }
private void bindAddress( SctpClientChannel channel, ChannelFuture future, InetAddress localAddress) { try { channel.channel.bindAddress(localAddress); future.setSuccess(); } catch (Throwable t) { future.setFailure(t); fireExceptionCaught(channel, t); } }
try { if (channel.setClosed()) { future.setSuccess(); if (bound) { fireChannelUnbound(channel); future.setSuccess();
future.setSuccess(); if (changed) { fireChannelInterestChanged(channel);
private void bind( SctpClientChannel channel, ChannelFuture future, SocketAddress localAddress) { try { channel.channel.bind(localAddress); channel.boundManually = true; channel.setBound(); future.setSuccess(); fireChannelBound(channel, channel.getLocalAddress()); } catch (Throwable t) { future.setFailure(t); fireExceptionCaught(channel, t); } }
void close(SctpChannelImpl channel, ChannelFuture future) { boolean connected = channel.isConnected(); boolean bound = channel.isBound(); try { channel.channel.close(); cancelledKeys++; if (channel.setClosed()) { future.setSuccess(); if (connected) { fireChannelDisconnected(channel); } if (bound) { fireChannelUnbound(channel); } cleanUpWriteBuffer(channel); fireChannelClosed(channel); } else { future.setSuccess(); } } catch (Throwable t) { future.setFailure(t); fireExceptionCaught(channel, t); } }
private void bind( SctpServerChannelImpl channel, ChannelFuture future, SocketAddress localAddress) { boolean bound = false; boolean bossStarted = false; try { channel.serverChannel.bind(localAddress, channel.getConfig().getBacklog()); bound = true; channel.setBound(); future.setSuccess(); fireChannelBound(channel, channel.getLocalAddress()); Executor bossExecutor = ((SctpServerSocketChannelFactory) channel.getFactory()).bossExecutor; DeadLockProofWorker.start(bossExecutor, new Boss(channel)); bossStarted = true; } catch (Throwable t) { future.setFailure(t); fireExceptionCaught(channel, t); } finally { if (!bossStarted && bound) { close(channel, future); } } }
evt = null; buf = null; future.setSuccess(); } else {