summaryrefslogtreecommitdiffstats
path: root/libjava/java/net/ServerSocket.java
diff options
context:
space:
mode:
authormembar <membar@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-30 13:43:21 +0000
committermembar <membar@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-30 13:43:21 +0000
commitc84ee5906d9eec1122bcd768f6256744d351f322 (patch)
tree49b741adeec23a17d6a07df2869147de34f24174 /libjava/java/net/ServerSocket.java
parent18f7351bba9d8e3cb2749017514a6cf277dbe6c1 (diff)
downloadppe42-gcc-c84ee5906d9eec1122bcd768f6256744d351f322.tar.gz
ppe42-gcc-c84ee5906d9eec1122bcd768f6256744d351f322.zip
* gnu/java/net/PlainSocketImpl.java
(inChannelOperation): New field. (isInChannelOperation): New accessor. (setInChannelOperation): New modifier. * gnu/java/nio/ServerSocketChannelImpl.java (accept): Set and reset our server socket's PlainSocketImpl's "in channel operation" indicator before and after delegating the accept to our server socket. * gnu/java/nio/SocketChannelImpl.java (connect): Set and reset our socket's PlainSocketImpl's "in channel operation" indicator before and after delegating the operation to our socket. (read): Likewise. (write): Likewise. * java/net/ServerSocket.java (implAccept): Don't throw an IllegalBlockingModeException if we have a non-blocking channel which initiated this accept operation. * java/net/Socket.java (connect): Don't throw an IllegalBlockingModeException if we have a non-blocking channel which initiated this connect operation. * java/nio/channels/spi/AbstractSelectableChannel.java (configureBlocking): Only call implConfigureBlocking() if the desired blocking mode is different from our current one. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76956 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/net/ServerSocket.java')
-rw-r--r--libjava/java/net/ServerSocket.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/libjava/java/net/ServerSocket.java b/libjava/java/net/ServerSocket.java
index 9a2d82d9c76..a53ebf674d1 100644
--- a/libjava/java/net/ServerSocket.java
+++ b/libjava/java/net/ServerSocket.java
@@ -1,5 +1,6 @@
/* ServerSocket.java -- Class for implementing server side sockets
- 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.
@@ -345,9 +346,14 @@ public class ServerSocket
if (isClosed())
throw new SocketException("ServerSocket is closed");
+ // 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())
- throw new IllegalBlockingModeException();
+ && !getChannel().isBlocking ()
+ && !((PlainSocketImpl) getImpl()).isInChannelOperation())
+ throw new IllegalBlockingModeException ();
impl.accept(socket.getImpl());
}
OpenPOWER on IntegriCloud