git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@528744
13f79535-47bb-0310-9956-
ffa450edef68
public void addEvent(Runnable event) {
events.offer(event);
- if ( wakeupCounter.incrementAndGet() < 3 ) selector.wakeup();
+ if ( wakeupCounter.incrementAndGet() == 1 || wakeupCounter.get() > 5 ) selector.wakeup();
}
/**
int keyCount = 0;
try {
if ( !close ) {
- keyCount = selector.select(selectorTimeout);
+ if ( wakeupCounter.get() > 0 )
+ keyCount = selector.selectNow(); //we have events that need to be processed
+ else
+ keyCount = selector.select(selectorTimeout);
wakeupCounter.set(0);
}
if (close) {
* The application write buffer size in bytes\r
* Default value is txBufSize\r
*/\r
- protected int appWriteBufSize = 8192;\r
+ protected int appWriteBufSize = txBufSize;\r
\r
/**\r
* NioChannel pool size for the endpoint,\r