classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Patch: don't close sockets on exception


From: Anthony Green
Subject: [cp-patches] Patch: don't close sockets on exception
Date: Mon, 26 Dec 2005 17:46:15 -0800

I've been debugging various problems with Azureus.  This is the first of
several patches. 

This first patch stops us from closing a socket when we get an exception
during connect().  It is standard behaviour to get timeout exception
here for non-blocking socket connect().  We will never get a proper
connection if we close() the socket at this point.

Ok to apply?

AG



2005-12-26  Anthony Green  <address@hidden>

        * java/net/Socket.java (connect): Don't close the socket on
        exceptions.


--- java/net/Socket.java~       2005-11-16 04:03:51.000000000 -0500
+++ java/net/Socket.java        2005-12-26 10:07:43.000000000 -0500
@@ -437,25 +437,7 @@
     if (! isBound())
       bind(null);
 
-    try
-      {
-       getImpl().connect(endpoint, timeout);
-      }
-    catch (IOException exception)
-      {
-       close();
-       throw exception;
-      }
-    catch (RuntimeException exception)
-      {
-       close();
-       throw exception;
-      }
-    catch (Error error)
-      {
-       close();
-       throw error;
-      }
+    getImpl().connect(endpoint, timeout);
   }
 
   /**







reply via email to

[Prev in Thread] Current Thread [Next in Thread]