You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Ray Chen (JIRA)" <ji...@apache.org> on 2009/10/20 08:46:59 UTC
[jira] Updated: (HARMONY-6360) [classlib][luni]SocketTest and
UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0
[ 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.