You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by od...@apache.org on 2009/10/23 15:35:13 UTC

svn commit: r829058 - /harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SocketChannelImpl.java

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);