You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by jv...@apache.org on 2007/09/17 16:14:44 UTC

svn commit: r576450 - /mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoProcessor.java

Author: jvermillard
Date: Mon Sep 17 07:14:42 2007
New Revision: 576450

URL: http://svn.apache.org/viewvc?rev=576450&view=rev
Log:
select() return boolean in place of number of selected sessions

Modified:
    mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoProcessor.java

Modified: mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoProcessor.java
URL: http://svn.apache.org/viewvc/mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoProcessor.java?rev=576450&r1=576449&r2=576450&view=diff
==============================================================================
--- mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoProcessor.java (original)
+++ mina/trunk/core/src/main/java/org/apache/mina/common/AbstractIoProcessor.java Mon Sep 17 07:14:42 2007
@@ -58,7 +58,13 @@
         this.executor = executor;
     }
 
-    protected abstract int select(int timeout) throws Exception;
+    /**
+     * poll those sessions for the given timeout 
+     * @param timeout milliseconds before the call timeout if no event appear
+     * @return true if at least a session is ready for read or for write 
+     * @throws Exception if some low level IO error occurs
+     */
+    protected abstract boolean select(int timeout) throws Exception;
 
     protected abstract void wakeup();
 
@@ -571,12 +577,12 @@
 
             for (;;) {
                 try {
-                    int nKeys = select(1000);
+                    boolean selected=select(1000);
 
                     nSessions += add();
                     updateTrafficMask();
 
-                    if (nKeys > 0) {
+                    if (selected) {
                         process();
                     }