harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r829058 - /harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SocketChannelImpl.java
Date Fri, 23 Oct 2009 13:35:13 GMT
Author: odeakin
Date: Fri Oct 23 13:35:13 2009
New Revision: 829058

URL: http://svn.apache.org/viewvc?rev=829058&view=rev
Log:
Since connectWithTimeout() only throws ConnectException when the connect has completely failed
(refused connection etc.) and not when it is pending, setting the status to pending in this
case is incorrect.

Modified:
    harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SocketChannelImpl.java

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SocketChannelImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SocketChannelImpl.java?rev=829058&r1=829057&r2=829058&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SocketChannelImpl.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SocketChannelImpl.java
Fri Oct 23 13:35:13 2009
@@ -277,15 +277,11 @@
             finished = (CONNECT_SUCCESS == result);
             isBound = finished;
         } catch (IOException e) {
-            if (e instanceof ConnectException && !isBlocking()) {
-                status = SOCKET_STATUS_PENDING;
-            } else {
-                if (isOpen()) {
-                    close();
-                    finished = true;
-                }
-                throw e;
+            if (isOpen()) {
+                close();
+                finished = true;
             }
+            throw e;
         } finally {
             if (isBlocking()) {
                 end(finished);



Mime
View raw message