[forwarded from http://bugs.debian.org/240550] If a ServerSocketChannel has been registered for SelectionKey.OP_ACCEPT at a Selector, select() will return immediatly with OP_ACCEPT on that Channel, even when there is no connection waiting. See example attached. Compile and run it with: gcj-3.3 --main=Server Server.java && ./a.out and it will output: Before selector Something was selected. Before accept. and hang in the ServerSocket.accept() method until a connection happens. Using gcj-3.4 (20040314): Before selector [waiting] Something was selected. Before accept. java.nio.channels.IllegalBlockingModeException at java.net.ServerSocket.implAccept(java.net.Socket) (/usr/lib/gcc-snapshot/lib/libgcj.so.5.0.0) at gnu.java.nio.NIOServerSocket.accept() (/usr/lib/gcc-snapshot/lib/libgcj.so.5.0.0) at Server.main(java.lang.String[]) (Unknown Source)
Created attachment 6007 [details] example
Running the program with strace shows that two sockets are created (fd 5 and 6). The second socket (fd 6) is the one that is later given an address with bind(2), the first socket (fd 5) is the one that is used in the select(2) call.
Confirmed.
I'm working on it.
2005-01-15> I'm working on it. Michael, any progress ;-? Matthias
Give back.
Closing as won't fix as libgcj (and the java front-end) has been removed from the trunk.