Message1684
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. |
|
Date |
User |
Action |
Args |
2008-02-20 17:17:52 | admin | link | issue1745068 messages |
2008-02-20 17:17:52 | admin | create | |
|