directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r329831 - in /directory/network: branches/0.8/src/java/org/apache/mina/io/socket/ trunk/src/java/org/apache/mina/transport/socket/nio/support/ trunk/src/test/org/apache/mina/examples/echoserver/
Date Mon, 31 Oct 2005 14:54:39 GMT
Author: trustin
Date: Mon Oct 31 06:54:28 2005
New Revision: 329831

URL: http://svn.apache.org/viewcvs?rev=329831&view=rev
Log:
* Optimized SocketIoProcessor.notifyIdleSessions()
* Removed wrong comments


Modified:
    directory/network/branches/0.8/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java
    directory/network/trunk/src/test/org/apache/mina/examples/echoserver/ConnectorTest.java

Modified: directory/network/branches/0.8/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/0.8/src/java/org/apache/mina/io/socket/SocketIoProcessor.java?rev=329831&r1=329830&r2=329831&view=diff
==============================================================================
--- directory/network/branches/0.8/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
(original)
+++ directory/network/branches/0.8/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
Mon Oct 31 06:54:28 2005
@@ -318,24 +318,20 @@
 
     private void notifyIdleSessions()
     {
-        Set keys = selector.keys();
-        Iterator it;
-        SocketSession session;
-
         // process idle sessions
         long currentTime = System.currentTimeMillis();
-
-        if( ( keys != null ) && ( ( currentTime - lastIdleCheckTime ) >= 1000
) )
+        if( ( currentTime - lastIdleCheckTime ) >= 1000 )
         {
             lastIdleCheckTime = currentTime;
-            it = keys.iterator();
-
-            while( it.hasNext() )
+            Set keys = selector.keys();
+            if( keys != null )
             {
-                SelectionKey key = ( SelectionKey ) it.next();
-                session = ( SocketSession ) key.attachment();
-
-                notifyIdleSession( session, currentTime );
+                for( Iterator it = keys.iterator(); it.hasNext(); )
+                {
+                    SelectionKey key = ( SelectionKey ) it.next();
+                    SocketSession session = ( SocketSession ) key.attachment();
+                    notifyIdleSession( session, currentTime );
+                }
             }
         }
     }

Modified: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java?rev=329831&r1=329830&r2=329831&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java
(original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java
Mon Oct 31 06:54:28 2005
@@ -318,24 +318,20 @@
 
     private void notifyIdleSessions()
     {
-        Set keys = selector.keys();
-        Iterator it;
-        SocketSessionImpl session;
-
         // process idle sessions
         long currentTime = System.currentTimeMillis();
-
-        if( ( keys != null ) && ( ( currentTime - lastIdleCheckTime ) >= 1000
) )
+        if( ( currentTime - lastIdleCheckTime ) >= 1000 )
         {
             lastIdleCheckTime = currentTime;
-            it = keys.iterator();
-
-            while( it.hasNext() )
+            Set keys = selector.keys();
+            if( keys != null )
             {
-                SelectionKey key = ( SelectionKey ) it.next();
-                session = ( SocketSessionImpl ) key.attachment();
-
-                notifyIdleSession( session, currentTime );
+                for( Iterator it = keys.iterator(); it.hasNext(); )
+                {
+                    SelectionKey key = ( SelectionKey ) it.next();
+                    SocketSessionImpl session = ( SocketSessionImpl ) key.attachment();
+                    notifyIdleSession( session, currentTime );
+                }
             }
         }
     }

Modified: directory/network/trunk/src/test/org/apache/mina/examples/echoserver/ConnectorTest.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/test/org/apache/mina/examples/echoserver/ConnectorTest.java?rev=329831&r1=329830&r2=329831&view=diff
==============================================================================
--- directory/network/trunk/src/test/org/apache/mina/examples/echoserver/ConnectorTest.java
(original)
+++ directory/network/trunk/src/test/org/apache/mina/examples/echoserver/ConnectorTest.java
Mon Oct 31 06:54:28 2005
@@ -62,9 +62,6 @@
         testConnector( connector );
     }
     
-    /**
-     * Client-side SSL doesn't work for now.
-     */
     public void testTCPWithSSL() throws Exception
     {
         // Add an SSL filter to acceptor
@@ -95,7 +92,7 @@
     {
         System.out.println("* Without localAddress");
         testConnector( connector, false );
-        
+            
         System.out.println("* With localAddress");
         testConnector( connector, true );
     }



Mime
View raw message