From: fhanik Date: Wed, 12 Jul 2006 23:29:52 +0000 (+0000) Subject: The NIO connector uses only one poller, so the poller doesn't need to be comet or... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e0bdeb3e0b57a7f36855256a2fd9cb09bc72cf0e;p=tomcat7.0 The NIO connector uses only one poller, so the poller doesn't need to be comet or non comet. Instead the comet status is kept with the key/socket for future reference. This can enable us to end the comet request on the server side in the future, yet maintain the keep alive. git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@421461 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index dbaf5c9e2..939923fc6 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -323,7 +323,6 @@ public class NioEndpoint { public Poller getPoller() { pollerRoundRobin = (pollerRoundRobin + 1) % pollers.length; Poller poller = pollers[pollerRoundRobin]; - poller.comet = false; return poller; } @@ -333,7 +332,6 @@ public class NioEndpoint { */ public Poller getCometPoller() { Poller poller = getPoller(); - poller.comet = true; return poller; } @@ -620,7 +618,7 @@ public class NioEndpoint { // Start poller threads pollers = new Poller[pollerThreadCount]; for (int i = 0; i < pollerThreadCount; i++) { - pollers[i] = new Poller(false); + pollers[i] = new Poller(); pollers[i].init(); Thread pollerThread = new Thread(pollers[i], getName() + "-Poller-" + i); pollerThread.setPriority(threadPriority); @@ -969,15 +967,13 @@ public class NioEndpoint { protected Selector selector; protected LinkedList events = new LinkedList(); protected boolean close = false; - protected boolean comet = true; protected int keepAliveCount = 0; public int getKeepAliveCount() { return keepAliveCount; } - public Poller(boolean comet) throws IOException { - this.comet = comet; + public Poller() throws IOException { this.selector = Selector.open(); } @@ -1139,7 +1135,7 @@ public class NioEndpoint { if ( attachment.getWakeUp() ) { attachment.setWakeUp(false); synchronized (attachment.getMutex()) {attachment.getMutex().notifyAll();} - } else if ( comet ) { + } else if ( attachment.getComet() ) { if (!processSocket(channel,false)) processSocket(channel,true); } else { boolean close = (!processSocket(channel));