Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 33092 invoked from network); 19 Apr 2007 08:08:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Apr 2007 08:08:40 -0000 Received: (qmail 28413 invoked by uid 500); 19 Apr 2007 08:08:44 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 28394 invoked by uid 500); 19 Apr 2007 08:08:44 -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 28385 invoked by uid 99); 19 Apr 2007 08:08:44 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Apr 2007 01:08:44 -0700 X-ASF-Spam-Status: No, hits=2.3 required=10.0 tests=HTML_MESSAGE,MAILTO_TO_SPAM_ADDR,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of zhanghuangzhu@gmail.com designates 64.233.184.228 as permitted sender) Received: from [64.233.184.228] (HELO wr-out-0506.google.com) (64.233.184.228) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Apr 2007 01:08:37 -0700 Received: by wr-out-0506.google.com with SMTP id i31so516172wra for ; Thu, 19 Apr 2007 01:08:16 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=bW46EX3cRYXQsT6lxxJCYq0TlMcTkn0EjYGCgc4q+LunyX7ZE+8xKJUgKa9yjtUQpIgTWnqyTHKNJdxKQejRDigaJaSjt+c66NIwYi2INBLiEQ5c7xvI4VuCUuNbzEvIJfCtAhVOq6rlRx3v1ZoCTlDjUxX4qjEi7Xe+TYJ6XnI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=KOkf1DF5yeHlCMLVIcJFBIOFnpT9BtKz7AyK67mG0JJs/airaruSmkyjW5KaCpygvsUcY9qsv3i28fYZ+Wp5s12JcxDykvbhzWIwYGMVpzzn41XMiCDJwEVj/Le92P7nYWFNwKMY7yl+uPaVNYKn26E6MuUqq+tv74deaE1nNX4= Received: by 10.70.50.10 with SMTP id x10mr2782758wxx.1176970096617; Thu, 19 Apr 2007 01:08:16 -0700 (PDT) Received: by 10.100.131.19 with HTTP; Thu, 19 Apr 2007 01:08:16 -0700 (PDT) Message-ID: <4d0b24970704190108m6f75c438jecd4ad0a25f1ed1c@mail.gmail.com> Date: Thu, 19 Apr 2007 16:08:16 +0800 From: "Andrew Zhang" To: dev@harmony.apache.org Subject: Re: [classlib][luni] new test in tests.api.java.net.SocketTest failed on my Windows XP sp2 In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_155110_7052462.1176970096354" References: <7273946b0704170150u10fe9f13vd430f0a3aa0399e2@mail.gmail.com> <46248CBA.7010702@gmail.com> <7273946b0704170216k43e3165cx30a19eb0ce27ea92@mail.gmail.com> <462498F7.6050300@gmail.com> <4624B462.1030607@gmail.com> <4626D9B0.4060606@gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_155110_7052462.1176970096354 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 4/19/07, Leo Li wrote: > > Personally I prefer Support_PortManager. As a tool, it can rescue us from > choosing specific port to use. Despite of its defect, I believe it is > possible to innovate it to fullfill our demand. From my experience, it > works > well on windows but has some problem on linux. > > Furthermore, if we would like to use a specific port but not predefined at > compile time, as the case of Ruth, maybe we can adopt a method of ad-hoc, > that is to try a specific port, if it is occupied, try another till it > works. I think at most we need a utility method: ServerSocket NetworkUtil.startServerSocket() { return new ServerSocket(0); } Why do we need to: 1. open a server socket on free port 2. get the server socket port 3. close it 4. pass the port to the test case 5. the test case opens a server socket on this port Isn't it the same as: The test case opens a server socket on free port? Or did I missing something? On 4/19/07, Ruth Cao wrote: > > > > Tim Ellison wrote: > > > Ruth Cao wrote: > > > > > >> You are right, Vladimir. > > >> > > >> It is just because the 'port' variable is set to 8080 and on some > > >> machines this port has already been occupied. The test case will > pass > > >> if we use Support_PortManager.getNextPort() on my side. > > >> > > > > > > Please don't use the PortManager, just open port 0 and let the OS > > > allocate a free port. There are examples in the existing tests. > > > > > > Regards, > > > Tim > > > > > > > > Yes, I agree that we should use port 0 in almost all the test cases. > > However, it seems that this test case is a little bit special. It > > requires to initialize a ServerSocket to connect 0.0.0.0 after > > connecting localhost successfully. If we use port 0 and 0.0.0.0 at the > > same time, the ServerSocket constructed will be invalid. > > > > Thus, shall we assign a rarely-used port (e.g. 50000), or continue using > > Support_PortManager? Any ideas? Suggestions? > > > > -- > > Regards, > > > > Ruth Cao > > China Software Development Lab, IBM > > > > > > > > > -- > Leo Li > China Software Development Lab, IBM > -- Best regards, Andrew Zhang ------=_Part_155110_7052462.1176970096354--