You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Rory Winston <rw...@eircom.net> on 2005/05/02 23:07:27 UTC

[net] available() returns 0 in Unit Test

When I was cutting the RC for Commons::Net, the TelnetClientTest repeatedly failed. I tracked this down to the line:

if(is1.available() == 6)

The available() method continually returned 0. When I commented out the available() check, the test passed as expected. I compiled with Java 5. 

The issue is that the test expected the socket's InputStream to return the #bytes queued up (6), whereas it actually returned 0, but it still read the bytes correctly on a read().

Anyone know if this is expected/reasonable behaviour? I havent looked into it yet, but if anyone has any insight, it would be appreciated.

Cheers
Rory


_________________________________________________________________
Sign up for eircom broadband now and get a free two month trial.*
Phone 1850 73 00 73 or visit http://home.eircom.net/broadbandoffer



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org