well, I discovered two huge bugs in the java.nio package.  The first one 
I mailed to Matthew and it is that the read() reads bytes as signed 
octets even though  in the javadocs it explicitly says the values 
InputStream.read() returns ranges 0-255.  So for example 0xfb is -5, not 
251.  This will require severe workarounds in the 
authentication/handshaking code, but is doable.

The second bug is that if the remote host closes the socket, the 
select() returns immediately and the thread enters infinite loop.  This 
requires manual canceling of the channel registration, but now that I 
know why it happens its trivial to write.  As a matter of fact, we might 
have on thread listen for everything - fcp, fnp, open connections, etc.

Unfortunately the signed byte thing will delay me considerably because 
frankly I don't know the authentication stuff very well.  Its especially 
hard to test, since there are many possible authentication scenarios and 
its a labor to dig through the logfiles to find out whether connection 
attempt failed because of authentication or something else.

_______________________________________________
devl mailing list
devl at freenetproject.org
http://hawk.freenetproject.org:8080/cgi-bin/mailman/listinfo/devl

Reply via email to