summaryrefslogtreecommitdiff
path: root/gnu/java/nio/SelectorImpl.java
diff options
context:
space:
mode:
authorAnthony Green <green@redhat.com>2005-12-27 02:34:20 +0000
committerAnthony Green <green@redhat.com>2005-12-27 02:34:20 +0000
commit8f7f61fb9faa07c750e44df46b4145735bc6ce5e (patch)
tree6d8e39e80e7ee7a8126d04490828f02642661f99 /gnu/java/nio/SelectorImpl.java
parentf5783469d949f57b1296d0f72ecc818024fa23d2 (diff)
downloadclasspath-8f7f61fb9faa07c750e44df46b4145735bc6ce5e.tar.gz
2005-12-26 Anthony Green <green@redhat.com>
* gnu/java/nio/SelectorImpl.java (select): Handle OP_CONNECT properly.
Diffstat (limited to 'gnu/java/nio/SelectorImpl.java')
-rw-r--r--gnu/java/nio/SelectorImpl.java25
1 files changed, 12 insertions, 13 deletions
diff --git a/gnu/java/nio/SelectorImpl.java b/gnu/java/nio/SelectorImpl.java
index dcafedeb8..70fe3f62e 100644
--- a/gnu/java/nio/SelectorImpl.java
+++ b/gnu/java/nio/SelectorImpl.java
@@ -284,19 +284,18 @@ public class SelectorImpl extends AbstractSelector
// Set new ready write ops
for (int i = 0; i < write.length; i++)
{
- if (key.getNativeFD() == write[i])
- {
- ops = ops | SelectionKey.OP_WRITE;
-
- // if (key.channel ().isConnected ())
- // {
- // ops = ops | SelectionKey.OP_WRITE;
- // }
- // else
- // {
- // ops = ops | SelectionKey.OP_CONNECT;
- // }
- }
+ if (key.getNativeFD() == write[i])
+ {
+ if (key.channel() instanceof SocketChannel)
+ {
+ if (((SocketChannel) key.channel ()).isConnected ())
+ ops = ops | SelectionKey.OP_WRITE;
+ else
+ ops = ops | SelectionKey.OP_CONNECT;
+ }
+ else
+ ops = ops | SelectionKey.OP_WRITE;
+ }
}
// FIXME: We dont handle exceptional file descriptors yet.