directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r158881 - in directory/network/trunk: project.xml src/java/org/apache/mina/io/datagram/DatagramAcceptor.java src/test/org/apache/mina/io/AbstractBindTest.java
Date Thu, 24 Mar 2005 05:14:49 GMT
Author: trustin
Date: Wed Mar 23 21:14:46 2005
New Revision: 158881

URL: http://svn.apache.org/viewcvs?view=rev&rev=158881
Log:
* Disabled datagram BindTest because JDK has file descriptor leakage.
* Modified DatagramAcceptor to work in more exceptional situation.



Modified:
    directory/network/trunk/project.xml
    directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java
    directory/network/trunk/src/test/org/apache/mina/io/AbstractBindTest.java

Modified: directory/network/trunk/project.xml
URL: http://svn.apache.org/viewcvs/directory/network/trunk/project.xml?view=diff&r1=158880&r2=158881
==============================================================================
--- directory/network/trunk/project.xml (original)
+++ directory/network/trunk/project.xml Wed Mar 23 21:14:46 2005
@@ -144,6 +144,7 @@
 
       <excludes>
         <exclude>**/Abstract*</exclude>
+	<exclude>**/datagram/BindTest*</exclude>
       </excludes>
     </unitTest>
 

Modified: directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java?view=diff&r1=158880&r2=158881
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java (original)
+++ directory/network/trunk/src/java/org/apache/mina/io/datagram/DatagramAcceptor.java Wed
Mar 23 21:14:46 2005
@@ -118,7 +118,22 @@
         if( request.exception != null )
         {
             request.exception.fillInStackTrace();
-            throw request.exception;
+            if( request.exception instanceof IOException )
+            {
+                throw ( IOException ) request.exception;
+            }
+            else if( request.exception instanceof RuntimeException )
+            {
+                throw ( RuntimeException ) request.exception;
+            }
+            else if( request.exception instanceof Error )
+            {
+                throw ( Error ) request.exception;
+            }
+            else
+            {
+                throw new IllegalStateException();
+            }
         }
     }
 
@@ -422,9 +437,9 @@
                 ch.register( selector, SelectionKey.OP_READ, req.handler );
                 channels.put( req.address, ch );
             }
-            catch( IOException e )
+            catch( Throwable t )
             {
-                req.exception = e;
+                req.exception = t;
             }
             finally
             {
@@ -440,7 +455,7 @@
                     {
                         ch.close();
                     }
-                    catch( IOException e )
+                    catch( Throwable e )
                     {
                         exceptionMonitor.exceptionCaught( this, e );
                     }
@@ -484,9 +499,9 @@
                     ch.close();
                 }
             }
-            catch( IOException e )
+            catch( Throwable t )
             {
-                exceptionMonitor.exceptionCaught( this, e );
+                exceptionMonitor.exceptionCaught( this, t );
             }
             finally
             {
@@ -515,7 +530,7 @@
         
         private final IoHandler handler;
         
-        private IOException exception; 
+        private Throwable exception; 
         
         private boolean done;
         

Modified: directory/network/trunk/src/test/org/apache/mina/io/AbstractBindTest.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/test/org/apache/mina/io/AbstractBindTest.java?view=diff&r1=158880&r2=158881
==============================================================================
--- directory/network/trunk/src/test/org/apache/mina/io/AbstractBindTest.java (original)
+++ directory/network/trunk/src/test/org/apache/mina/io/AbstractBindTest.java Wed Mar 23 21:14:46
2005
@@ -98,8 +98,8 @@
     {
         InetSocketAddress addr = new InetSocketAddress( port );
         EchoProtocolHandler handler = new EchoProtocolHandler();
-        // we test only 512 times to avoid too many open files exception.
-        for( int i = 0; i < 512; i++ ) 
+        // we test only 8192 times to avoid too many open files exception.
+        for( int i = 0; i < 8192; i++ ) 
         {
             acceptor.unbind( addr );
             acceptor.bind( addr, handler );



Mime
View raw message