@Override public final void bind(final SocketAddress localAddress, final ChannelPromise promise) { assertEventLoop(); if (!promise.setUncancellable() || !ensureOpen(promise)) { return; doBind(localAddress); } catch (Throwable t) { safeSetFailure(promise, t); closeIfClosed(); return; invokeLater(new Runnable() { @Override public void run() { safeSetSuccess(promise);
register0(promise); } else { try { "Force-closing a channel whose registration task was not accepted by an event loop: {}", AbstractChannel.this, t); closeForcibly(); closeFuture.setClosed(); safeSetFailure(promise, t);
new ChannelOutputShutdownException("Channel output shutdown") : new ChannelOutputShutdownException("Channel output shutdown", cause); Executor closeExecutor = prepareToClose(); if (closeExecutor != null) { closeExecutor.execute(new Runnable() { promise.setFailure(err); } finally { closeOutboundBufferForShutdown(pipeline, outboundBuffer, shutdownCause);
if (closeFuture.isDone()) { safeSetSuccess(promise); } else if (!(promise instanceof VoidChannelPromise)) { // Only needed if no VoidChannelPromise. final ChannelOutboundBuffer outboundBuffer = this.outboundBuffer; this.outboundBuffer = null; // Disallow adding any messages and flushes to outboundBuffer. Executor closeExecutor = prepareToClose(); if (closeExecutor != null) { closeExecutor.execute(new Runnable() { try { doClose0(promise); } finally { if (outboundBuffer != null) { invokeLater(new Runnable() { @Override public void run() { fireChannelInactiveAndDeregister(wasActive);
if (closeFuture.isDone()) { safeSetSuccess(promise); } else if (!(promise instanceof VoidChannelPromise)) { // Only needed if no VoidChannelPromise. final ChannelOutboundBuffer outboundBuffer = this.outboundBuffer; this.outboundBuffer = null; // Disallow adding any messages and flushes to outboundBuffer. Executor closeExecutor = prepareToClose(); if (closeExecutor != null) { closeExecutor.execute(new Runnable() { try { doClose0(promise); } finally { if (outboundBuffer != null) { invokeLater(new Runnable() { @Override public void run() { fireChannelInactiveAndDeregister(wasActive);
if (closeFuture.isDone()) { safeSetSuccess(promise); } else if (!(promise instanceof VoidChannelPromise)) { // Only needed if no VoidChannelPromise. final ChannelOutboundBuffer outboundBuffer = this.outboundBuffer; this.outboundBuffer = null; // Disallow adding any messages and flushes to outboundBuffer. Executor closeExecutor = prepareToClose(); if (closeExecutor != null) { closeExecutor.execute(new Runnable() { try { doClose0(promise); } finally { if (outboundBuffer != null) { invokeLater(new Runnable() { @Override public void run() { fireChannelInactiveAndDeregister(wasActive);
new ChannelOutputShutdownException("Channel output shutdown") : new ChannelOutputShutdownException("Channel output shutdown", cause); Executor closeExecutor = prepareToClose(); if (closeExecutor != null) { closeExecutor.execute(new Runnable() { promise.setFailure(err); } finally { closeOutboundBufferForShutdown(pipeline, outboundBuffer, shutdownCause);
new ChannelOutputShutdownException("Channel output shutdown") : new ChannelOutputShutdownException("Channel output shutdown", cause); Executor closeExecutor = prepareToClose(); if (closeExecutor != null) { closeExecutor.execute(new Runnable() { promise.setFailure(err); } finally { closeOutboundBufferForShutdown(pipeline, outboundBuffer, shutdownCause);
new ChannelOutputShutdownException("Channel output shutdown") : new ChannelOutputShutdownException("Channel output shutdown", cause); Executor closeExecutor = prepareToClose(); if (closeExecutor != null) { closeExecutor.execute(new Runnable() { promise.setFailure(err); } finally { closeOutboundBufferForShutdown(pipeline, outboundBuffer, shutdownCause);
@Override public final void bind(final SocketAddress localAddress, final ChannelPromise promise) { assertEventLoop(); if (!promise.setUncancellable() || !ensureOpen(promise)) { return; doBind(localAddress); } catch (Throwable t) { safeSetFailure(promise, t); closeIfClosed(); return; invokeLater(new Runnable() { @Override public void run() { safeSetSuccess(promise);
if (!promise.setUncancellable() || !ensureOpen(promise)) { return; safeSetSuccess(promise); pipeline.fireChannelRegistered(); beginRead(); closeForcibly(); closeFuture.setClosed(); safeSetFailure(promise, t);
register0(promise); } else { try { "Force-closing a channel whose registration task was not accepted by an event loop: {}", AbstractChannel.this, t); closeForcibly(); closeFuture.setClosed(); safeSetFailure(promise, t);
@Override public final void bind(final SocketAddress localAddress, final ChannelPromise promise) { assertEventLoop(); if (!promise.setUncancellable() || !ensureOpen(promise)) { return; doBind(localAddress); } catch (Throwable t) { safeSetFailure(promise, t); closeIfClosed(); return; invokeLater(new Runnable() { @Override public void run() { safeSetSuccess(promise);
if (!promise.setUncancellable() || !ensureOpen(promise)) { return; safeSetSuccess(promise); pipeline.fireChannelRegistered(); beginRead(); closeForcibly(); closeFuture.setClosed(); safeSetFailure(promise, t);
register0(promise); } else { try { "Force-closing a channel whose registration task was not accepted by an event loop: {}", AbstractChannel.this, t); closeForcibly(); closeFuture.setClosed(); safeSetFailure(promise, t);
@Override public final void bind(final SocketAddress localAddress, final ChannelPromise promise) { assertEventLoop(); if (!promise.setUncancellable() || !ensureOpen(promise)) { return; doBind(localAddress); } catch (Throwable t) { safeSetFailure(promise, t); closeIfClosed(); return; invokeLater(new Runnable() { @Override public void run() { safeSetSuccess(promise);
if (!promise.setUncancellable() || !ensureOpen(promise)) { return; safeSetSuccess(promise); pipeline.fireChannelRegistered(); beginRead(); closeForcibly(); closeFuture.setClosed(); safeSetFailure(promise, t);
register0(promise); } else { try { "Force-closing a channel whose registration task was not accepted by an event loop: {}", AbstractChannel.this, t); closeForcibly(); closeFuture.setClosed(); safeSetFailure(promise, t);
@Override public final void disconnect(final ChannelPromise promise) { assertEventLoop(); if (!promise.setUncancellable()) { return; } boolean wasActive = isActive(); try { doDisconnect(); } catch (Throwable t) { safeSetFailure(promise, t); closeIfClosed(); return; } if (wasActive && !isActive()) { invokeLater(new Runnable() { @Override public void run() { pipeline.fireChannelInactive(); } }); } safeSetSuccess(promise); closeIfClosed(); // doDisconnect() might have closed the channel }
@Override public final void disconnect(final ChannelPromise promise) { assertEventLoop(); if (!promise.setUncancellable()) { return; } boolean wasActive = isActive(); try { doDisconnect(); } catch (Throwable t) { safeSetFailure(promise, t); closeIfClosed(); return; } if (wasActive && !isActive()) { invokeLater(new Runnable() { @Override public void run() { pipeline.fireChannelInactive(); } }); } safeSetSuccess(promise); closeIfClosed(); // doDisconnect() might have closed the channel }