summaryrefslogtreecommitdiff
path: root/gnu/java/net/PlainSocketImpl.java
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2004-02-06 09:13:23 +0000
committerMichael Koch <konqueror@gmx.de>2004-02-06 09:13:23 +0000
commit9c4f694033cff2a2c955ec9aa1bd7baf874fc06e (patch)
tree0bc0828df239ad3bf211635f564e7240804b9e5e /gnu/java/net/PlainSocketImpl.java
parentc01c55fe280172bac8de0271571874fcd0b5d2c3 (diff)
downloadclasspath-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/net/PlainSocketImpl.java')
-rw-r--r--gnu/java/net/PlainSocketImpl.java29
1 files changed, 28 insertions, 1 deletions
diff --git a/gnu/java/net/PlainSocketImpl.java b/gnu/java/net/PlainSocketImpl.java
index 3656967c9..871efc7c5 100644
--- a/gnu/java/net/PlainSocketImpl.java
+++ b/gnu/java/net/PlainSocketImpl.java
@@ -1,5 +1,5 @@
/* PlainSocketImpl.java -- Default socket implementation
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -97,6 +97,33 @@ public final class PlainSocketImpl extends SocketImpl
private OutputStream out;
/**
+ * Indicates whether a channel initiated whatever operation
+ * is being invoked on this socket.
+ */
+ private boolean inChannelOperation;
+
+ /**
+ * Indicates whether we should ignore whether any associated
+ * channel is set to non-blocking mode. Certain operations
+ * throw an <code>IllegalBlockingModeException</code> if the
+ * associated channel is in non-blocking mode, <i>except</i>
+ * if the operation is invoked by the channel itself.
+ */
+ public final boolean isInChannelOperation()
+ {
+ return inChannelOperation;
+ }
+
+ /**
+ * Sets our indicator of whether an I/O operation is being
+ * initiated by a channel.
+ */
+ public final void setInChannelOperation(boolean b)
+ {
+ inChannelOperation = b;
+ }
+
+ /**
* Default do nothing constructor
*/
public PlainSocketImpl()