directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r351888 - in /directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support: DatagramAcceptorDelegate.java DatagramConnectorDelegate.java SocketIoProcessor.java
Date Sat, 03 Dec 2005 04:39:58 GMT
Author: trustin
Date: Fri Dec  2 20:39:53 2005
New Revision: 351888

URL: http://svn.apache.org/viewcvs?rev=351888&view=rev
Log:
* Fixed unexpected NullPointerException

Modified:
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java
    directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java

Modified: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java?rev=351888&r1=351887&r2=351888&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java
(original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java
Fri Dec  2 20:39:53 2005
@@ -223,7 +223,11 @@
     public void flushSession( DatagramSessionImpl session )
     {
         scheduleFlush( session );
-        selector.wakeup();
+        Selector selector = this.selector;
+        if( selector != null )
+        {
+            selector.wakeup();
+        }
     }
 
     public void closeSession( DatagramSessionImpl session )

Modified: directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java?rev=351888&r1=351887&r2=351888&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java
(original)
+++ directory/network/trunk/src/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java
Fri Dec  2 20:39:53 2005
@@ -196,7 +196,11 @@
     public void flushSession( DatagramSessionImpl session )
     {
         scheduleFlush( session );
-        selector.wakeup();
+        Selector selector = this.selector;
+        if( selector != null )
+        {
+            selector.wakeup();
+        }
     }
 
     private void scheduleFlush( DatagramSessionImpl session )
@@ -210,6 +214,11 @@
     public void updateTrafficMask( DatagramSessionImpl session )
     {
         scheduleTrafficControl( session );
+        Selector selector = this.selector;
+        if( selector != null )
+        {
+            selector.wakeup();
+        }
         selector.wakeup();
     }
     

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=351888&r1=351887&r2=351888&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
Fri Dec  2 20:39:53 2005
@@ -63,7 +63,7 @@
      */
     static synchronized SocketIoProcessor getInstance()
     {
-        SocketIoProcessor processor = PROCESSORS[nextId++];
+        SocketIoProcessor processor = PROCESSORS[ nextId ++ ];
         nextId %= PROCESSOR_COUNT;
         return processor;
     }
@@ -118,13 +118,21 @@
     void flush( SocketSessionImpl session )
     {
         scheduleFlush( session );
-        selector.wakeup();
+        Selector selector = this.selector;
+        if( selector != null )
+        {
+            selector.wakeup();
+        }
     }
 
     void updateTrafficMask( SocketSessionImpl session )
     {
         scheduleTrafficControl( session );
-        selector.wakeup();
+        Selector selector = this.selector;
+        if( selector != null )
+        {
+            selector.wakeup();
+        }
     }
 
     private void scheduleRemove( SocketSessionImpl session )



Mime
View raw message