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:44:59 UTC

[jira] Created: (HARMONY-6360) [classlib][luni]SocketTest and UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0

[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


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.


[jira] Commented: (HARMONY-6360) [classlib][luni]SocketTest and UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0

Posted by "Ray Chen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768142#action_12768142 ] 

Ray Chen commented on HARMONY-6360:
-----------------------------------

Hi Oli,

That's a good question. I will have a try, maybe still give it a free port
and add more comments.




-- 
Regards,

Ray Chen


> [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
>            Assignee: Oliver Deakin
>            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.
> If you try to connect to your mahchine with port 0 in C program will get EADDRNOTAVAIL error on AIX and zos but it works well on Linux.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6360) [classlib][luni]SocketTest and UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0

Posted by "Oliver Deakin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768687#action_12768687 ] 

Oliver Deakin commented on HARMONY-6360:
----------------------------------------

Hi Ray - thanks for the new patch. That looks better, but one thing still puzzles me. How can the ServerSocket get a free port when it is passed 0 but Socket cannot?

> [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
>            Assignee: Oliver Deakin
>            Priority: Minor
>         Attachments: 6360.diff, 6360_v2.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.
> If you try to connect to your mahchine with port 0 in C program will get EADDRNOTAVAIL error on AIX and zos but it works well on Linux.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6360) [classlib][luni]SocketTest and UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768893#action_12768893 ] 

Hudson commented on HARMONY-6360:
---------------------------------

Integrated in Harmony-1.5-head-linux-x86_64 #511 (See [http://hudson.zones.apache.org/hudson/job/Harmony-1.5-head-linux-x86_64/511/])
    Apply patch for  ([classlib][luni]SocketTest and UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0)


> [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
>            Assignee: Oliver Deakin
>            Priority: Minor
>             Fix For: 5.0M12
>
>         Attachments: 6360.diff, 6360_v2.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.
> If you try to connect to your mahchine with port 0 in C program will get EADDRNOTAVAIL error on AIX and zos but it works well on Linux.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6360) [classlib][luni]SocketTest and UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0

Posted by "Ray Chen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12767850#action_12767850 ] 

Ray Chen commented on HARMONY-6360:
-----------------------------------

Hi Oli,

Actually, I think the port is not important.

When excute the original statement "Socket s = new Socket("0.0.0.0", 0,
false);", there is no server at all.  If port 0 used in socket() function,
it means got a free port, and if port 0 used in connect() on Linux platform,
it means connect to any listening port of the address (your local machine
address here).

However, AIX and many other Unix platform didn't support port 0 used in
connect() function.

Since you have questions about this, I think the code is a little bit
confusing, maybe I should add some comments, right?




-- 
Regards,

Ray Chen


> [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
>            Assignee: Oliver Deakin
>            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.
> If you try to connect to your mahchine with port 0 in C program will get EADDRNOTAVAIL error on AIX and zos but it works well on Linux.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6360) [classlib][luni]SocketTest and UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0

Posted by "Ray Chen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ray Chen updated HARMONY-6360:
------------------------------

    Description: 
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.
If you try to connect to your mahchine with port 0 in C program will get EADDRNOTAVAIL error on AIX and zos but it works well on Linux.

  was:
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");
    }
}


> [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.
> If you try to connect to your mahchine with port 0 in C program will get EADDRNOTAVAIL error on AIX and zos but it works well on Linux.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6360) [classlib][luni]SocketTest and UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0

Posted by "Oliver Deakin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12767763#action_12767763 ] 

Oliver Deakin commented on HARMONY-6360:
----------------------------------------

Hi Ray,
Do you know if that UnixSocketTest works correctly on the RI on AIX? Can you successfully do "Socket socket = new Socket("127.0.0.1", 0, false);" on the RI on AIX, or does that also fail?

> [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
>            Assignee: Oliver Deakin
>            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.
> If you try to connect to your mahchine with port 0 in C program will get EADDRNOTAVAIL error on AIX and zos but it works well on Linux.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6360) [classlib][luni]SocketTest and UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0

Posted by "Ray Chen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768693#action_12768693 ] 

Ray Chen commented on HARMONY-6360:
-----------------------------------

AIX allow socket(port0), but do not allow connect(port0).

That's why we can create a server socket with port0, but we can not make a
client to a port0




-- 
Regards,

Ray Chen


> [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
>            Assignee: Oliver Deakin
>            Priority: Minor
>         Attachments: 6360.diff, 6360_v2.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.
> If you try to connect to your mahchine with port 0 in C program will get EADDRNOTAVAIL error on AIX and zos but it works well on Linux.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6360) [classlib][luni]SocketTest and UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0

Posted by "Ray Chen (JIRA)" <ji...@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_v2.diff

Latest patch gets a free port in UnixTest, and add some comments in both testcases.

> [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
>            Assignee: Oliver Deakin
>            Priority: Minor
>         Attachments: 6360.diff, 6360_v2.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.
> If you try to connect to your mahchine with port 0 in C program will get EADDRNOTAVAIL error on AIX and zos but it works well on Linux.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-6360) [classlib][luni]SocketTest and UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0

Posted by "Oliver Deakin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oliver Deakin resolved HARMONY-6360.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 5.0M12

Thanks Ray - I get it now :) Patch applied at repo revision r828837. Please check it applied as expected and close this JIRA.

> [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
>            Assignee: Oliver Deakin
>            Priority: Minor
>             Fix For: 5.0M12
>
>         Attachments: 6360.diff, 6360_v2.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.
> If you try to connect to your mahchine with port 0 in C program will get EADDRNOTAVAIL error on AIX and zos but it works well on Linux.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-6360) [classlib][luni]SocketTest and UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0

Posted by "Oliver Deakin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oliver Deakin reassigned HARMONY-6360:
--------------------------------------

    Assignee: Oliver Deakin

> [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
>            Assignee: Oliver Deakin
>            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.
> If you try to connect to your mahchine with port 0 in C program will get EADDRNOTAVAIL error on AIX and zos but it works well on Linux.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6360) [classlib][luni]SocketTest and UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0

Posted by "Ray Chen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768694#action_12768694 ] 

Ray Chen commented on HARMONY-6360:
-----------------------------------

Hi Oli,

This is the description copied from the Spec for the socket
construction -"Creates
a socket and connects it to the specified port number at the specified IP
address"

So here, it is server's IP and port, not local. In C it might be like
socket();
connect(ip, port ,len)

But in ServerSocket(0), it is also server's, but it is local port.
In C it might be like socket(family,port,...)

So this two sockets' role are different.





-- 
Regards,

Ray Chen


> [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
>            Assignee: Oliver Deakin
>            Priority: Minor
>         Attachments: 6360.diff, 6360_v2.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.
> If you try to connect to your mahchine with port 0 in C program will get EADDRNOTAVAIL error on AIX and zos but it works well on Linux.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6360) [classlib][luni]SocketTest and UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0

Posted by "Ray Chen (JIRA)" <ji...@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.


[jira] Commented: (HARMONY-6360) [classlib][luni]SocketTest and UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0

Posted by "Ray Chen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12767793#action_12767793 ] 

Ray Chen commented on HARMONY-6360:
-----------------------------------

Hi Oli,
That also failed on both RI and harmony




-- 
Regards,

Ray Chen


> [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
>            Assignee: Oliver Deakin
>            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.
> If you try to connect to your mahchine with port 0 in C program will get EADDRNOTAVAIL error on AIX and zos but it works well on Linux.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6360) [classlib][luni]SocketTest and UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0

Posted by "Ray Chen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12767858#action_12767858 ] 

Ray Chen commented on HARMONY-6360:
-----------------------------------

One more thing, these three test cases's purpose is to test the inputstream
or outputstream of the socket, it doesn't care about if the connection is
really connected. The question is AIX didn't allow to create a socket in
this way(connect to port 0).
-- 
Regards,

Ray Chen


> [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
>            Assignee: Oliver Deakin
>            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.
> If you try to connect to your mahchine with port 0 in C program will get EADDRNOTAVAIL error on AIX and zos but it works well on Linux.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6360) [classlib][luni]SocketTest and UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0

Posted by "Oliver Deakin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12767836#action_12767836 ] 

Oliver Deakin commented on HARMONY-6360:
----------------------------------------

Just one more thing on this - do you think the way the port is chosen in UnixSocketTest should be more like that in SocketTest. So instead of picking a fixed port number (which may be taken, and could cause intermittent failures because of this) we should make a getLocalPort() call and use that port number. Do you agree?

> [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
>            Assignee: Oliver Deakin
>            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.
> If you try to connect to your mahchine with port 0 in C program will get EADDRNOTAVAIL error on AIX and zos but it works well on Linux.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6360) [classlib][luni]SocketTest and UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0

Posted by "Oliver Deakin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768138#action_12768138 ] 

Oliver Deakin commented on HARMONY-6360:
----------------------------------------

I understand that the 0 port usage does not work on AIX correctly - Im just wondering if UnixSocketTest will still work as expected if port 2934 is already in use?

> [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
>            Assignee: Oliver Deakin
>            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.
> If you try to connect to your mahchine with port 0 in C program will get EADDRNOTAVAIL error on AIX and zos but it works well on Linux.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (HARMONY-6360) [classlib][luni]SocketTest and UnixSocketTest failed on AIX, because AIX do NOT support connect to port 0

Posted by "Ray Chen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ray Chen closed HARMONY-6360.
-----------------------------


Patch verified.

Thank you, Oli, your comments make this patch better.

> [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
>            Assignee: Oliver Deakin
>            Priority: Minor
>             Fix For: 5.0M12
>
>         Attachments: 6360.diff, 6360_v2.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.
> If you try to connect to your mahchine with port 0 in C program will get EADDRNOTAVAIL error on AIX and zos but it works well on Linux.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.