Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 87404 invoked from network); 5 Jul 2006 10:03:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Jul 2006 10:03:19 -0000 Received: (qmail 39744 invoked by uid 500); 5 Jul 2006 10:03:18 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 39637 invoked by uid 500); 5 Jul 2006 10:03:17 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 39626 invoked by uid 99); 5 Jul 2006 10:03:17 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jul 2006 03:03:17 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jul 2006 03:03:16 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3B3974103DD for ; Wed, 5 Jul 2006 10:01:30 +0000 (GMT) Message-ID: <33136835.1152093690224.JavaMail.jira@brutus> Date: Wed, 5 Jul 2006 10:01:30 +0000 (GMT+00:00) From: "George Harley (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Assigned: (HARMONY-754) [classlib][nio] java.nio.channels.DatagramChannel.read(ByteBuffer[]) and read(ByteBuffer[],int,int) fail to return even some data are available. In-Reply-To: <16152692.1152069989762.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 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-754?page=all ] George Harley reassigned HARMONY-754: ------------------------------------- Assign To: George Harley > [classlib][nio] java.nio.channels.DatagramChannel.read(ByteBuffer[]) and read(ByteBuffer[],int,int) fail to return even some data are available. > ------------------------------------------------------------------------------------------------------------------------------------------------ > > Key: HARMONY-754 > URL: http://issues.apache.org/jira/browse/HARMONY-754 > Project: Harmony > Type: Bug > Components: Classlib > Reporter: Andrew Zhang > Assignee: George Harley > Attachments: nio.diff > > java.nio.channels.DatagramChannel.read(ByteBuffer[]) and read(ByteBuffer[],int,int) fail to return even some data are available. > Following test reproduces the problem: > public void test_read_$LByteBuffer() throws Exception { > int capcity = 64; > DatagramChannel channel1 = DatagramChannel.open(); > DatagramChannel channel2 = DatagramChannel.open(); > // make connection between channel1 and channel2 > channel1.socket().bind( > new InetSocketAddress(InetAddress.getLocalHost(), 0)); > channel2.socket().bind( > new InetSocketAddress(InetAddress.getLocalHost(), 0)); > channel1.connect(channel2.socket().getLocalSocketAddress()); > channel2.connect(channel1.socket().getLocalSocketAddress()); > // channel2 writes some data to channel1 > channel2.write(ByteBuffer.allocate(capcity)); > ByteBuffer[] readBuf = new ByteBuffer[2]; > readBuf[0] = ByteBuffer.allocateDirect(capcity); > readBuf[1] = ByteBuffer.allocateDirect(capcity); > channel1.configureBlocking(true); > // channel1 reads some data from channel2 > // Harmony hangs at this line. > long ret = channel1.read(readBuf); > assertEquals(capcity, ret); > } > RI passes the test while Harmony fails. > I'll upload a patch soon. > Thanks! > Best regards, > Andrew -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira