From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1766 invoked by alias); 28 Mar 2004 10:11:35 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 1658 invoked by uid 48); 28 Mar 2004 10:11:33 -0000 Date: Sun, 28 Mar 2004 10:11:00 -0000 From: "debian-gcc at lists dot debian dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20040328101128.14759.debian-gcc@lists.debian.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug libgcj/14759] New: ServerSocketChannel causes Selector.select() to return immediatly X-Bugzilla-Reason: CC X-SW-Source: 2004-03/txt/msg03229.txt.bz2 List-Id: [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) -- Summary: ServerSocketChannel causes Selector.select() to return immediatly Product: gcc Version: 3.3.4 Status: UNCONFIRMED Severity: normal Priority: P2 Component: libgcj AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: debian-gcc at lists dot debian dot org CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14759