Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 24647 invoked from network); 20 Oct 2009 06:47:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 Oct 2009 06:47:23 -0000 Received: (qmail 57609 invoked by uid 500); 20 Oct 2009 06:47:23 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 57567 invoked by uid 500); 20 Oct 2009 06:47:23 -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 57443 invoked by uid 99); 20 Oct 2009 06:47:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Oct 2009 06:47:22 +0000 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; Tue, 20 Oct 2009 06:47:20 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8354A234C1EE for ; Mon, 19 Oct 2009 23:46:59 -0700 (PDT) Message-ID: <680596170.1256021219536.JavaMail.jira@brutus> Date: Tue, 20 Oct 2009 06:46:59 +0000 (UTC) From: "Ray Chen (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-6360) [classlib][luni]SocketTest and UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0 In-Reply-To: <1922235056.1256021099519.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-6360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ray Chen updated HARMONY-6360: ------------------------------ Attachment: 6360.diff In the patch, just use the port generated when new one ServerSocket above in SocketTest.java. And simply use a port number in UnixSocketTest.java. > [classlib][luni]SocketTest and UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0 > --------------------------------------------------------------------------------------------------------- > > Key: HARMONY-6360 > URL: https://issues.apache.org/jira/browse/HARMONY-6360 > Project: Harmony > Issue Type: Test > Components: Classlib > Environment: AIX > Reporter: Ray Chen > Priority: Minor > Attachments: 6360.diff > > Original Estimate: 0.5h > Remaining Estimate: 0.5h > > SocketTest failed on AIX at the statement "Socket s = new Socket("0.0.0.0", 0, false);" which create a socket in local and connect to IP address and port specified (0.0.0.0:0), which in turn actually connect to (machineIP:0) in PlainSocketImpl.java > However AIX and some other Unix platform do NOT support connect to port 0. > For example, following small C program will get EADDRNOTAVAIL error on AIX and zos but works well on Linux. > #define PORT 0 > #define SERVER_IP "127.0.0.1" /*your machine IP*/ > main() > { > int s; > struct sockaddr_in addr; > char buffer[256]; > if((s = socket(AF_INET, SOCK_DGRAM, 0)) <0) { > perror("socket"); > exit(1); > } > > bzero(&addr, sizeof(addr)); > addr.sin_family = AF_INET; > addr.sin_port = htons(PORT); > addr.sin_addr.s_addr= inet_addr(SERVER_IP); > > if(connect(s, (struct sockaddr*)&addr, sizeof(addr))<0) { > perror("connect"); > printf("%d\n",errno); > exit(1); > } else { > printf("connect successfully\n"); > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.