aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/net/Socket.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/net/Socket.java')
-rw-r--r--libjava/java/net/Socket.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/libjava/java/net/Socket.java b/libjava/java/net/Socket.java
index 9322e92..f9cbb7e 100644
--- a/libjava/java/net/Socket.java
+++ b/libjava/java/net/Socket.java
@@ -1,5 +1,6 @@
/* Socket.java -- Client socket implementation
- Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004
+ Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -420,8 +421,13 @@ public class Socket
if (! (endpoint instanceof InetSocketAddress))
throw new IllegalArgumentException("unsupported address type");
+ // The Sun spec says that if we have an associated channel and
+ // it is in non-blocking mode, we throw an IllegalBlockingModeException.
+ // However, in our implementation if the channel itself initiated this
+ // operation, then we must honor it regardless of its blocking mode.
if (getChannel() != null
- && !getChannel().isBlocking ())
+ && !getChannel().isBlocking ()
+ && !((PlainSocketImpl) getImpl()).isInChannelOperation())
throw new IllegalBlockingModeException ();
if (!isBound ())