Merge pull request #556 from netty/jdk_bug_workaround

Don't rely on the return value fo Selector.select(..) as it is buggy and...
This commit is contained in:
Norman Maurer 2012-08-25 11:11:05 -07:00
commit 1a6e7b4be1

View File

@ -242,7 +242,7 @@ class NioClientSocketPipelineSink extends AbstractNioChannelSink {
wakenUp.set(false);
try {
int selectedKeyCount = selector.select(10);
SelectorUtil.select(selector);
// 'wakenUp.compareAndSet(false, true)' is always evaluated
// before calling 'selector.wakeup()' to reduce the wake-up
@ -277,10 +277,7 @@ class NioClientSocketPipelineSink extends AbstractNioChannelSink {
}
processRegisterTaskQueue();
if (selectedKeyCount > 0) {
processSelectedKeys(selector.selectedKeys());
}
processSelectedKeys(selector.selectedKeys());
// Handle connection timeout every 10 milliseconds approximately.
long currentTimeNanos = System.nanoTime();