Message1684

Author amak
Recipients
Date 2007-06-29.11:55:28
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
The select behaviour is correct. However, the error message should be a lot clearer.

You have to put your sockets into non-blocking mode in order for your code to work. So before you do the select call, do this

s1.setblocking(0)
s2.setblocking(0)

You can see this in the java documentation by looking at the docs for IllegalBlockingModeException

http://java.sun.com/j2se/1.4.2/docs/api/java/nio/channels/IllegalBlockingModeException.html

Which says " ... exception thrown when a blocking-mode-specific operation is invoked upon a channel in the incorrect blocking mode.".

I need to clean up the exception handling in this case to better explain what is happening.
History
Date User Action Args
2008-02-20 17:17:52adminlinkissue1745068 messages
2008-02-20 17:17:52admincreate