void reset() { reset(0); }
void reset() { reset(0); }
@Override public int select() throws IOException { selectionKeys.reset(); return delegate.select(); }
@Override public int select(long timeout) throws IOException { selectionKeys.reset(); return delegate.select(timeout); }
@Override public int selectNow() throws IOException { selectionKeys.reset(); return delegate.selectNow(); }
@Override public int selectNow() throws IOException { selectionKeys.reset(); return delegate.selectNow(); }
void reset() { reset(0); }
@Override public int select() throws IOException { selectionKeys.reset(); return delegate.select(); }
@Override public int select(long timeout) throws IOException { selectionKeys.reset(); return delegate.select(timeout); }
@Override public int select(long timeout) throws IOException { selectionKeys.reset(); return delegate.select(timeout); }
@Override public int selectNow() throws IOException { selectionKeys.reset(); return delegate.selectNow(); }
@Override public int select() throws IOException { selectionKeys.reset(); return delegate.select(); }
private void processSelectedKeysOptimized() { for (int i = 0; i < selectedKeys.size; ++i) { final SelectionKey k = selectedKeys.keys[i]; // null out entry in the array to allow to have it GC'ed once the Channel close // See https://github.com/netty/netty/issues/2363 selectedKeys.keys[i] = null; final Object a = k.attachment(); if (a instanceof AbstractNioChannel) { processSelectedKey(k, (AbstractNioChannel) a); } else { @SuppressWarnings("unchecked") NioTask<SelectableChannel> task = (NioTask<SelectableChannel>) a; processSelectedKey(k, task); } if (needsToSelectAgain) { // null out entries in the array to allow to have it GC'ed once the Channel close // See https://github.com/netty/netty/issues/2363 selectedKeys.reset(i + 1); selectAgain(); i = -1; } } }
private void processSelectedKeysOptimized() { for (int i = 0; i < selectedKeys.size; ++i) { final SelectionKey k = selectedKeys.keys[i]; // null out entry in the array to allow to have it GC'ed once the Channel close // See https://github.com/netty/netty/issues/2363 selectedKeys.keys[i] = null; final Object a = k.attachment(); if (a instanceof AbstractNioChannel) { processSelectedKey(k, (AbstractNioChannel) a); } else { @SuppressWarnings("unchecked") NioTask<SelectableChannel> task = (NioTask<SelectableChannel>) a; processSelectedKey(k, task); } if (needsToSelectAgain) { // null out entries in the array to allow to have it GC'ed once the Channel close // See https://github.com/netty/netty/issues/2363 selectedKeys.reset(i + 1); selectAgain(); i = -1; } } }
private void processSelectedKeysOptimized() { for (int i = 0; i < selectedKeys.size; ++i) { final SelectionKey k = selectedKeys.keys[i]; // null out entry in the array to allow to have it GC'ed once the Channel close // See https://github.com/netty/netty/issues/2363 selectedKeys.keys[i] = null; final Object a = k.attachment(); if (a instanceof AbstractNioChannel) { processSelectedKey(k, (AbstractNioChannel) a); } else { @SuppressWarnings("unchecked") NioTask<SelectableChannel> task = (NioTask<SelectableChannel>) a; processSelectedKey(k, task); } if (needsToSelectAgain) { // null out entries in the array to allow to have it GC'ed once the Channel close // See https://github.com/netty/netty/issues/2363 selectedKeys.reset(i + 1); selectAgain(); i = -1; } } }
@Override public int select(long timeout) throws IOException { selectionKeys.reset(); return delegate.select(timeout); }
@Override public int selectNow() throws IOException { selectionKeys.reset(); return delegate.selectNow(); }
@Override public int select() throws IOException { selectionKeys.reset(); return delegate.select(); }
@Override public int select(long timeout) throws IOException { selectionKeys.reset(); return delegate.select(timeout); }
@Override public int select() throws IOException { selectionKeys.reset(); return delegate.select(); }