There is diffrent behavior in nio between windows and Solaris/linux.
In windows, java.nio.channels.Selecor#select does not block under the follwoing condition.
- Valid IP address
- Send a packet to the destination of which the port is closed
(Please see the attached DatagramTest.java)
In platforms other than Windows, java.nio.channels.Selecor#select seems to block.
CONFIGURATION:
JDK : 1.4.2_XX/5ux/6ux/7b85
OS : WindowsXP/Vista/7
REPRODUCE:
1. Compile the attached program, "DatagramTest.java"
2. Invoke "java DatagramTest"
FREQUENCY :
this problem always occurs
EXPECTED :
Only "step1" message appears.
ACTUAL :
step1
valid:true
readable:true
writable:false