Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 3328 invoked from network); 3 Mar 2008 12:34:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Mar 2008 12:34:02 -0000 Received: (qmail 39137 invoked by uid 500); 3 Mar 2008 12:33:55 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 39122 invoked by uid 500); 3 Mar 2008 12:33:55 -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 39092 invoked by uid 99); 3 Mar 2008 12:33:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Mar 2008 04:33:55 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Mar 2008 12:33:17 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7CE1B234C085 for ; Mon, 3 Mar 2008 04:32:51 -0800 (PST) Message-ID: <2004128597.1204547571510.JavaMail.jira@brutus> Date: Mon, 3 Mar 2008 04:32:51 -0800 (PST) From: "Tim Ellison (JIRA)" To: commits@harmony.apache.org Subject: [jira] Assigned: (HARMONY-5530) Selector.select() returns exception if network connection is lost In-Reply-To: <925367635.1203432889676.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-5530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tim Ellison reassigned HARMONY-5530: ------------------------------------ Assignee: Tim Ellison > Selector.select() returns exception if network connection is lost > ----------------------------------------------------------------- > > Key: HARMONY-5530 > URL: https://issues.apache.org/jira/browse/HARMONY-5530 > Project: Harmony > Issue Type: Bug > Components: Classlib > Affects Versions: 5.0M4 > Environment: Only test on Win32, Linux unknown at this time. > Reporter: Phil Loats > Assignee: Tim Ellison > > This problem was seen on version "harmony-jdk-603534" > When Selector.select() is called with an empty list, then the network connection is lost - an exception is thrown to the caller. > This behavior is different from J2SE 1.5 where it continues to wait without throwing an exception. > The following test code will show this problem: > import java.io.IOException; > import java.nio.channels.Selector; > public class Test { > public static void main(String[] args) { > Selector selector = null; > > try { > selector = Selector.open(); > System.out.println("selector open..."); > } catch (IOException e) { > } > > // Wait for events > while (true) { > try { > // Wait for an event > System.out.println("Waiting on selector..."); > selector.select(); > } catch (IOException e) { > // Handle error with selector > e.printStackTrace(); > break; > } > } > System.out.println("done..."); > } > } > Start the testcase, it will pause at "Waiting on selector..." message. Bring down the network connection ("ipconfig /release" I use), the following exception is thrown: > selector open... > Waiting on selector... > java.net.SocketException: The connection was reset > at org.apache.harmony.luni.platform.OSNetworkSystem.readSocketImpl(OSNetworkSystem.java) > at org.apache.harmony.luni.platform.OSNetworkSystem.read(OSNetworkSystem.java:89) > at org.apache.harmony.nio.internal.SocketChannelImpl.readImpl(SocketChannelImpl.java:459) > at org.apache.harmony.nio.internal.SocketChannelImpl.read(SocketChannelImpl.java:377) > at org.apache.harmony.nio.internal.PipeImpl$SourceChannelImpl.read(PipeImpl.java:133) > at org.apache.harmony.nio.internal.SelectorImpl.processSelectResult(SelectorImpl.java:526) > at org.apache.harmony.nio.internal.SelectorImpl.selectInternal(SelectorImpl.java:474) > at org.apache.harmony.nio.internal.SelectorImpl.select(SelectorImpl.java:432) > at Test.main(Test.java:30) > done... > Again, J2SE 1.5 remains paused at "Waiting..." when the network is lost or regained. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.