Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 88230 invoked from network); 18 Jun 2007 09:48:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Jun 2007 09:48:47 -0000 Received: (qmail 89526 invoked by uid 500); 18 Jun 2007 09:48:50 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 89505 invoked by uid 500); 18 Jun 2007 09:48:50 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 89488 invoked by uid 99); 18 Jun 2007 09:48:50 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jun 2007 02:48:50 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jun 2007 02:48:46 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 1670271419B for ; Mon, 18 Jun 2007 02:48:26 -0700 (PDT) Message-ID: <17017207.1182160106089.JavaMail.jira@brutus> Date: Mon, 18 Jun 2007 02:48:26 -0700 (PDT) From: "Sergey Dmitriev (JIRA)" To: commits@harmony.apache.org Subject: [jira] Created: (HARMONY-4212) [classlib][nio] deregistered channel.configureBlocking(true) throws IllegalBlockingModeException MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [classlib][nio] deregistered channel.configureBlocking(true) throws IllegalBlockingModeException ------------------------------------------------------------------------------------------------ Key: HARMONY-4212 URL: https://issues.apache.org/jira/browse/HARMONY-4212 Project: Harmony Issue Type: Bug Components: Classlib Reporter: Sergey Dmitriev In nio.channels: after deregistering and removing SocketChannel from selector calling channel.configureBlocking(true) throws IllegalBlockingModeException. Actually this not how it is have to be. Please see the mini test. (Please execute "telnet localhost 9999" in other shell after test launch). ] guy@box ~ ] cat select7.java import java.nio.channels.*; import java.net.*; import java.util.*; public class select7 { public static void main(String[] args) throws Exception { Selector selector = Selector.open(); ServerSocketChannel ssc = ServerSocketChannel.open(); ssc.socket().bind(new InetSocketAddress(9999)); // server listening System.out.println("Waiting on accept..."); SocketChannel sc = ssc.accept(); System.out.println("Done."); // register & select sc.configureBlocking(false); sc.register(selector, SelectionKey.OP_READ); System.out.println("Waiting on select()..."); int res = selector.select(); System.out.println("Done. " + res + " key(s) up."); // run through the selected keys Iterator readyKeys = selector.selectedKeys().iterator(); while (readyKeys.hasNext()) { SelectionKey key = (SelectionKey)readyKeys.next(); System.out.println("Selected key = " + key); key.cancel(); readyKeys.remove(); SelectableChannel ch = key.channel(); ch.configureBlocking(true); } } } ] guy@box ~ ] ~/jre2/bin/java -showversion select7 Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable. java version "1.5.0" pre-alpha : not complete or compatible svn = r540000, (May 21 2007), Linux/ia32/gcc 3.3.3, release build http://incubator.apache.org/harmony Waiting on accept... Done. Waiting on select()... Done. 1 key(s) up. Selected key = org.apache.harmony.nio.internal.SelectionKeyImpl@4507d7e0 Uncaught exception in main: java.nio.channels.IllegalBlockingModeException at java.nio.channels.spi.AbstractSelectableChannel.configureBlocking(AbstractSelectableChannel.java:206) at select7.main(select7.java:39) ] guy@box ~ ] java -showversion select7 java version "1.5.0_06" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05) BEA JRockit(R) (build R26.3.0-32-58710-1.5.0_06-20060308-2022-linux-ia32, ) Waiting on accept... Done. Waiting on select()... Done. 1 key(s) up. Selected key = sun.nio.ch.SelectionKeyImpl@10e847b -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.