diff options
author | Michael Koch <konqueror@gmx.de> | 2004-02-06 09:13:23 +0000 |
---|---|---|
committer | Michael Koch <konqueror@gmx.de> | 2004-02-06 09:13:23 +0000 |
commit | 9c4f694033cff2a2c955ec9aa1bd7baf874fc06e (patch) | |
tree | 0bc0828df239ad3bf211635f564e7240804b9e5e /gnu/java/nio/ServerSocketChannelImpl.java | |
parent | c01c55fe280172bac8de0271571874fcd0b5d2c3 (diff) | |
download | classpath-9c4f694033cff2a2c955ec9aa1bd7baf874fc06e.tar.gz |
2004-02-06 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/NIOServerSocket.java
(impl): Unused, removed.
* gnu/java/nio/SocketChannelImpl.java
(finnishConnect): Don't throw NoConnectionPendingException if not
connected or no connection pending.
2004-02-06 Mohan Embar <gnustuff@thisiscool.com>
* gnu/java/nio/DatagramChannelImpl.java
(inChannelOperation): New field.
(isInChannelOperation): New accessor.
(setInChannelOperation): New modifier.
(receive): Use capacity() - position() of destination
buffer instead of remaining(). Set and reset our "in
channel operation indicator" before and after delegating
the receive to our datagram socket. Removed testing code.
Update destination buffer's current position if it is
backed by a byte array (hasArray() is true).
(send): Set and reset our "in channel operation indicator"
before and after delegating the send to our datagram socket.
Removed testing code. Update source buffer's current position
if it is backed by a byte array (hasArray() is true).
* gnu/java/nio/SocketChannelImpl.java (read(ByteBuffer)):
Use capacity() - position() of destination buffer instead
of remaining().
* java/net/DatagramSocket.java (receive): Don't throw an
IllegalBlockingModeException if we have a non-blocking
channel which initiated this operation.
(send): Likewise.
2004-02-06 Mohan Embar <gnustuff@thisiscool.com>
* 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.
Diffstat (limited to 'gnu/java/nio/ServerSocketChannelImpl.java')
-rw-r--r-- | gnu/java/nio/ServerSocketChannelImpl.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gnu/java/nio/ServerSocketChannelImpl.java b/gnu/java/nio/ServerSocketChannelImpl.java index fd975d20a..76e1ce324 100644 --- a/gnu/java/nio/ServerSocketChannelImpl.java +++ b/gnu/java/nio/ServerSocketChannelImpl.java @@ -1,5 +1,5 @@ /* ServerSocketChannelImpl.java -- - Copyright (C) 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -69,7 +69,7 @@ public final class ServerSocketChannelImpl extends ServerSocketChannel { return serverSocket.getPlainSocketImpl().getNativeFD(); } - + public void finalizer() { if (connected) @@ -107,6 +107,11 @@ public final class ServerSocketChannelImpl extends ServerSocketChannel try { + begin(); + serverSocket.getPlainSocketImpl().setInChannelOperation(true); + // indicate that a channel is initiating the accept operation + // so that the socket ignores the fact that we might be in + // non-blocking mode. NIOSocket socket = (NIOSocket) serverSocket.accept(); completed = true; return socket.getChannel(); @@ -117,6 +122,7 @@ public final class ServerSocketChannelImpl extends ServerSocketChannel } finally { + serverSocket.getPlainSocketImpl().setInChannelOperation(false); end (completed); } } |