Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 57165 invoked from network); 26 Feb 2009 05:22:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Feb 2009 05:22:19 -0000 Received: (qmail 23671 invoked by uid 500); 26 Feb 2009 05:22:17 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 23638 invoked by uid 500); 26 Feb 2009 05:22:17 -0000 Mailing-List: contact dev-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 dev@harmony.apache.org Received: (qmail 23627 invoked by uid 99); 26 Feb 2009 05:22:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Feb 2009 21:22:17 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of xu.regis@gmail.com designates 74.125.92.148 as permitted sender) Received: from [74.125.92.148] (HELO qw-out-1920.google.com) (74.125.92.148) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Feb 2009 05:22:07 +0000 Received: by qw-out-1920.google.com with SMTP id 4so410224qwk.24 for ; Wed, 25 Feb 2009 21:21:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=Y5gdp5PRuuNqkDW8GrDCP0WqhM8flTcOdzmgjpNNczM=; b=o5jl4OunOZ/HGCtSF9stkc8pFBKXRDqIIdokH0Jor4XAu37OV8IAloux5i72sCov61 IbqS31S2b8ZUghcPkZS+4OTEJfCkqSdYRrFqDwL4hZNfQFgauFWu1rmJ+KiZk4nwjMDY CC+fEVxUFG1E0IjXZ2/o7xKezWzXsz0gOA890= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=TQDrUGVyx84G5c+Q4xijUEym6Nfs4o5q3LtsSYrL9fQcKU2NNIvMU/DnX7556qF8Er KzudmWxt3e2z4u8yH7qk0smkvmgS6+G8E0XehLIvFR3YhNSpmvS0q2yIjGFoYBgFhnu5 9sD0fN9EIOdJ7lAo+XuZMq0Iblh+zgMHid/+s= Received: by 10.224.89.17 with SMTP id c17mr1560086qam.309.1235625705835; Wed, 25 Feb 2009 21:21:45 -0800 (PST) Received: from ?9.123.237.97? ([220.248.0.145]) by mx.google.com with ESMTPS id 5sm763920qwh.59.2009.02.25.21.21.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 25 Feb 2009 21:21:44 -0800 (PST) Message-ID: <49A626E2.5020008@gmail.com> Date: Thu, 26 Feb 2009 13:21:38 +0800 From: Regis User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: dev@harmony.apache.org Subject: Re: svn commit: r747813 - /harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/SocketTest.java References: <20090225151354.D2FA4238887D@eris.apache.org> In-Reply-To: <20090225151354.D2FA4238887D@eris.apache.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, It seems the same problem of HARMONY-6090 and discussed here [1]. In Harmony, the SO_REUSEADDR's default value of ServerSocket is false on Linux, while RI is true, that cause the bind failed. I have attached a patch to fix it in Java code, you can try it :) I think it's better if it could be done in native code. [1] http://harmony.markmail.org/search/?q=SO_REUSEADDR#query:SO_REUSEADDR+page:1+mid:ylkmq4aaclmcr55b+state:results hindessm@apache.org wrote: > Author: hindessm > Date: Wed Feb 25 15:13:52 2009 > New Revision: 747813 > > URL: http://svn.apache.org/viewvc?rev=747813&view=rev > Log: > This test often fails for me because if the client connect completes > before the server socket closes then the client socket is left in > CLOSE_WAIT state. The CLOSE_WAIT socket is then still using the port > so the SECOND_TIME bind fails. Oddly it passes 100% of the time on > the RI because the close always seems to happen before the connect > completes and so the connect always fails with 0 return code. > > Modified: > harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/SocketTest.java > > Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/SocketTest.java > URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/SocketTest.java?rev=747813&r1=747812&r2=747813&view=diff > ============================================================================== > --- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/SocketTest.java (original) > +++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/net/SocketTest.java Wed Feb 25 15:13:52 2009 > @@ -93,8 +93,8 @@ > } > > socket.setSoTimeout(5000); > - socket.accept(); > - > + Socket client = socket.accept(); > + client.close(); > socket.close(); > } catch (IOException e) { > e.printStackTrace(); > > > -- Best Regards, Regis.