Problem with Selector.select() NIO

Are there still issues in

java.nio.channels.Selector.select() when running on solaris.

It perfectly works fine in windows XP.

We are able to register a selector with a channel and successfully retrieve SelectionKey. But when doing a select after registration the selection key is lost (count = 0) on solaris

selector.select(TIMEOUT_CHECK_INTERVAL);

returns count = 0;

We have tested with jdk1.5.06 as well as 1.5.11. The Solaris version is 5.9

There are no exceptions messages.

There are some thread posts realted to this issue, could barely see any answers.

http://forum.java.sun.com/thread.jspa?forumID=4&threadID=293672

http://forum.java.sun.com/thread.jspa?forumID=256&threadID=420607

Any help on this issue will be greatly appreciated.

[825 byte] By [kewljavaguya] at [2007-11-27 9:47:51]
# 1
What operations is the channel registered for? and are you sure those operations are ready? Zero from a select() just means no channels are ready.
ejpa at 2007-7-13 0:00:52 > top of Java-index,Core,Core APIs...
# 2

This is a client program.

1. Registers selector with a channel. Retrieved a valid Selection Key.

-

SelectionKey key;

try {

key = socketChannel.register(this.selector, 0);

request.setKey(key);

} catch (IOException ex) {

throw new IOReactorException("Failure registering channel " +

"with the selector", ex);

}

SessionRequestHandle requestHandle = new SessionRequestHandle(request);

key.attach(requestHandle);

key.interestOps(SelectionKey.OP_CONNECT);

--

2. select keys

for (;;) {

int readyCount;

try {

readyCount = this.selector.select(TIMEOUT_CHECK_INTERVAL);

} catch (InterruptedIOException ex) {

throw ex;

} catch (IOException ex) {

throw new IOReactorException("Unexpected selector failure", ex);

}

if (this.closed) {

break;

}

processSessionRequests();

if (readyCount > 0) {

processEvents(this.selector.selectedKeys());

}

Step 2 works in windows (returns count = 1) but in solaris returns 0 and no selected keys.

kewljavaguya at 2007-7-13 0:00:52 > top of Java-index,Core,Core APIs...
# 3
Solaris version: SunOS callisto 5.9 Generic_118558-39 sun4u sparc SUNW,Sun-Fire-280R Java: jdk1.5.0_06 & jdk1.5.0_11
kewljavaguya at 2007-7-13 0:00:52 > top of Java-index,Core,Core APIs...
# 4
So to be clear this is a newly created socket channel that you have just put into non-blocking mode and then executed connect() on?
ejpa at 2007-7-13 0:00:52 > top of Java-index,Core,Core APIs...