private void closeAll() { try { epollWaitNow(); } catch (IOException ignore) { // ignore on close } // Using the intermediate collection to prevent ConcurrentModificationException. // In the `close()` method, the channel is deleted from `channels` map. AbstractEpollChannel[] localChannels = channels.values().toArray(new AbstractEpollChannel[0]); for (AbstractEpollChannel ch : localChannels) { ch.unsafe().close(ch.unsafe().voidPromise()); } }
private void closeOnRead(ChannelPipeline pipeline) { if (isOpen()) { if (Boolean.TRUE.equals(config().getOption(ChannelOption.ALLOW_HALF_CLOSURE))) { shutdownInput(); pipeline.fireUserEventTriggered(ChannelInputShutdownEvent.INSTANCE); } else { unsafe().close(unsafe().voidPromise()); } pipeline.fireUserEventTriggered(ChannelInputShutdownReadComplete.INSTANCE); } }
private void closeOnRead(ChannelPipeline pipeline) { if (isOpen()) { if (Boolean.TRUE.equals(config().getOption(ChannelOption.ALLOW_HALF_CLOSURE))) { shutdownInput(); pipeline.fireUserEventTriggered(ChannelInputShutdownEvent.INSTANCE); } else { unsafe().close(unsafe().voidPromise()); } pipeline.fireUserEventTriggered(ChannelInputShutdownReadComplete.INSTANCE); } }
@Override protected void run() { for (;;) { Runnable task = takeTask(); if (task != null) { task.run(); updateLastExecutionTime(); } Channel ch = this.ch; if (isShuttingDown()) { if (ch != null) { ch.unsafe().close(ch.unsafe().voidPromise()); } if (confirmShutdown()) { break; } } else { if (ch != null) { // Handle deregistration if (!ch.isRegistered()) { runAllTasks(); deregister(); } } } } }
private void closeOnRead(ChannelPipeline pipeline) { if (isOpen()) { if (Boolean.TRUE.equals(config().getOption(ChannelOption.ALLOW_HALF_CLOSURE))) { shutdownInput(); pipeline.fireUserEventTriggered(ChannelInputShutdownEvent.INSTANCE); } else { unsafe().close(unsafe().voidPromise()); } pipeline.fireUserEventTriggered(ChannelInputShutdownReadComplete.INSTANCE); } }
protected final void clearReadFilter0() { assert eventLoop().inEventLoop(); try { readPending = false; readFilter(false); } catch (IOException e) { // When this happens there is something completely wrong with either the filedescriptor or epoll, // so fire the exception through the pipeline and close the Channel. pipeline().fireExceptionCaught(e); unsafe().close(unsafe().voidPromise()); } }
@Override public void run() { unsafe().close(unsafe().voidPromise()); } };
@Override public void closeForcibly() { close(unsafe().voidPromise()); }
@Override public void run() { unsafe().close(unsafe().voidPromise()); } };
protected final void clearEpollIn0() { assert eventLoop().inEventLoop(); try { readPending = false; clearFlag(Native.EPOLLIN); } catch (IOException e) { // When this happens there is something completely wrong with either the filedescriptor or epoll, // so fire the exception through the pipeline and close the Channel. pipeline().fireExceptionCaught(e); unsafe().close(unsafe().voidPromise()); } }
private void tryClose(boolean isActive) { if (isActive) { unsafe().close(unsafe().voidPromise()); } else { releaseInboundBuffers(); } }
@Override protected void run() { for (;;) { Runnable task = takeTask(); if (task != null) { task.run(); updateLastExecutionTime(); } Channel ch = this.ch; if (isShuttingDown()) { if (ch != null) { ch.unsafe().close(ch.unsafe().voidPromise()); } if (confirmShutdown()) { break; } } else { if (ch != null) { // Handle deregistration if (!ch.isRegistered()) { runAllTasks(); deregister(); } } } } }
protected final void clearReadFilter0() { assert eventLoop().inEventLoop(); try { readPending = false; readFilter(false); } catch (IOException e) { // When this happens there is something completely wrong with either the filedescriptor or epoll, // so fire the exception through the pipeline and close the Channel. pipeline().fireExceptionCaught(e); unsafe().close(unsafe().voidPromise()); } }
protected final void clearEpollIn0() { assert eventLoop().inEventLoop(); try { readPending = false; clearFlag(Native.EPOLLIN); } catch (IOException e) { // When this happens there is something completely wrong with either the filedescriptor or epoll, // so fire the exception through the pipeline and close the Channel. pipeline().fireExceptionCaught(e); unsafe().close(unsafe().voidPromise()); } }
@Override public void run() { unsafe().close(unsafe().voidPromise()); } };
@Override public void run() { unsafe().close(unsafe().voidPromise()); } };
private void tryClose(boolean isActive) { if (isActive) { unsafe().close(unsafe().voidPromise()); } else { releaseInboundBuffers(); } }
private void tryClose(boolean isActive) { if (isActive) { unsafe().close(unsafe().voidPromise()); } else { releaseInboundBuffers(); } }
@Override public void run() { unsafe().close(unsafe().voidPromise()); } };
@Override public void run() { unsafe().close(unsafe().voidPromise()); } };