summaryrefslogtreecommitdiffstats
path: root/libjava/gnu/java/nio/SelectionKeyImpl.java
diff options
context:
space:
mode:
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-29 09:57:05 +0000
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-29 09:57:05 +0000
commitd50299082035ea2e1c8c1a44b4779fe5152a082b (patch)
treeadcaaa3a449aead6635ab9800c8f3f5ba50315d9 /libjava/gnu/java/nio/SelectionKeyImpl.java
parent8803ae556c5ccfce56ae37c9014802f842329e52 (diff)
downloadppe42-gcc-d50299082035ea2e1c8c1a44b4779fe5152a082b.tar.gz
ppe42-gcc-d50299082035ea2e1c8c1a44b4779fe5152a082b.zip
2002-11-29 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/DatagramChannelImpl: (fd): New member variable to store file descriptor of socket. * gnu/java/nio/SelectionKeyImpl.java: (ops): Removed. (readyOps): New member variable. (interestOps): New member variable. (readyOps): Implemented. (readyOps): New method to set member variable readyOps. (interestOps): Replaced ops by interestOps. * gnu/java/nio/SelectorImpl.java: (SelectorImpl): Initialize key sets. (select): Call select with -1 instead of Long.MAX_VALUE). (java_do_select): Make it a native method. (getFDsAsArray): New helper method. (select): Remove canceled keys, give only interested file discriptors to java_do_select, set ready ops. (add): No need to initialize keys set here. (add_selected): No need to initialize selected set here. (deregisterCanceledKeys): New helper method. (register): Set interest ops, set attachments, added handling of datagram channels. * gnu/java/nio/ServerSocketChannelImpl: (SocketAccept): Renamed from NioSocketAccept. (implConfigureBlocking): Implemented. (accept): Use SocketAccept instead of NioSocketAccept. * gnu/java/nio/SocketChannelImpl: Reactivate native methods. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59632 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu/java/nio/SelectionKeyImpl.java')
-rw-r--r--libjava/gnu/java/nio/SelectionKeyImpl.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/libjava/gnu/java/nio/SelectionKeyImpl.java b/libjava/gnu/java/nio/SelectionKeyImpl.java
index 8ef6f7f27cb..5763d6880d3 100644
--- a/libjava/gnu/java/nio/SelectionKeyImpl.java
+++ b/libjava/gnu/java/nio/SelectionKeyImpl.java
@@ -44,7 +44,9 @@ import java.nio.channels.spi.AbstractSelectionKey;
public class SelectionKeyImpl extends AbstractSelectionKey
{
- int fd, ops;
+ int fd;
+ int readyOps;
+ int interestOps;
SelectorImpl impl;
SelectableChannel ch;
@@ -62,17 +64,23 @@ public class SelectionKeyImpl extends AbstractSelectionKey
public int readyOps ()
{
- return 0;
+ return readyOps;
+ }
+
+ public SelectionKey readyOps (int ops)
+ {
+ readyOps = ops;
+ return this;
}
public int interestOps ()
{
- return ops;
+ return interestOps;
}
public SelectionKey interestOps (int ops)
{
- this.ops = ops;
+ interestOps = ops;
return this;
}
OpenPOWER on IntegriCloud