Author: fhanik Date: Wed Jul 12 16:29:52 2006 New Revision: 421461 URL: http://svn.apache.org/viewvc?rev=421461&view=rev Log: 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.
Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=421461&r1=421460&r2=421461&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Wed Jul 12 16:29:52 2006 @@ -323,7 +323,6 @@ public Poller getPoller() { pollerRoundRobin = (pollerRoundRobin + 1) % pollers.length; Poller poller = pollers[pollerRoundRobin]; - poller.comet = false; return poller; } @@ -333,7 +332,6 @@ */ public Poller getCometPoller() { Poller poller = getPoller(); - poller.comet = true; return poller; } @@ -620,7 +618,7 @@ // 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 @@ protected Selector selector; protected LinkedList<Runnable> events = new LinkedList<Runnable>(); 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 @@ 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)); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]