diff options
| author | Casey Marshall <csm@gnu.org> | 2006-09-20 21:06:56 +0000 |
|---|---|---|
| committer | Casey Marshall <csm@gnu.org> | 2006-09-20 21:06:56 +0000 |
| commit | 084a2d68af18443b005a1c50a20edb588d1155cb (patch) | |
| tree | a21c30bf910778799e11769894ea5ce683d64078 /gnu/java/nio/SocketChannelImpl.java | |
| parent | ec279b6d8608e09c1bb8ec2c33b648d82eaff981 (diff) | |
| download | classpath-084a2d68af18443b005a1c50a20edb588d1155cb.tar.gz | |
2006-09-20 Casey Marshall <csm@gnu.org>
* gnu/java/nio/SocketChannelImpl.java (finishConnect): don't
call `isConnected.'
(isConnected): return false if `connectionPending' is true.
Diffstat (limited to 'gnu/java/nio/SocketChannelImpl.java')
| -rw-r--r-- | gnu/java/nio/SocketChannelImpl.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gnu/java/nio/SocketChannelImpl.java b/gnu/java/nio/SocketChannelImpl.java index 459decf52..1c563ac09 100644 --- a/gnu/java/nio/SocketChannelImpl.java +++ b/gnu/java/nio/SocketChannelImpl.java @@ -175,14 +175,15 @@ public final class SocketChannelImpl extends SocketChannel connectionPending = !connected; return connected; } - - public boolean finishConnect () + + public boolean finishConnect() throws IOException { if (!isOpen()) throw new ClosedChannelException(); - - if (isConnected()) + + InetSocketAddress remote = channel.getPeerAddress(); + if (remote != null) { connectionPending = false; return true; @@ -196,6 +197,10 @@ public final class SocketChannelImpl extends SocketChannel public boolean isConnected() { + // Wait until finishConnect is called before transitioning to + // connected. + if (connectionPending) + return false; try { InetSocketAddress remote = channel.getPeerAddress(); |
