From: Alan K. <jyt...@xh...> - 2007-07-31 22:29:16
|
[Raghuram] >>I get an exception with the error message similar to "Exception: Got >>92500 bytes but 107500 bytes were written.". The actual numbers vary >>but the error is always same. [Charlie] > That's the failure I was getting before I increased SELECT_TIMEOUT. I > imagine if you increase it a little more, the test will pass. This > still leaves the question of why it's failing at all though, as I > think it should be fine with a SELECT_TIMEOUT of 0. If it sheds any light, the java selector method used is different for different values of timeout. For a timeout value of 0, the selectNow() method is used, which is non-blocking. For a timeout of None, select() is used, which is blocking. For a positive timeout value, select(int) is used, which times out after int milliseconds. http://java.sun.com/j2se/1.4.2/docs/api/java/nio/channels/Selector.html Alan. |