We weren't properly recording OP_CONNECT events in our select routine. After coming up with this, I discovered that this is basically the same solution that Stanley Brown came up with over a year ago... http://gcc.gnu.org/ml/java/2004-09/msg00130.html
2005-12-26 Anthony Green <[EMAIL PROTECTED]> * gnu/java/nio/SelectorImpl.java (select): Handle OP_CONNECT properly. --- gnu/java/nio/SelectorImpl.java~ 2005-10-28 17:36:04.000000000 -0400 +++ gnu/java/nio/SelectorImpl.java 2005-12-26 16:33:03.000000000 -0500 @@ -284,19 +284,18 @@ // 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. _______________________________________________ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches