[ 
http://issues.apache.org/jira/browse/AXISCPP-847?page=comments#action_12331451 
] 

nadir amra commented on AXISCPP-847:
------------------------------------

I will look into this further.  An invalid socket should be -1.  I think 
(please someone comment if not) that this is true for windows sockets so that 
chaning invalid socket constant to -1 should be ok. 

The reason people do not have trouble with this on other platforms is because 
descriptors 0, 1, and 2 are reserved for stdin, stdout and stderr.  On OS/400, 
if you kick off your program from within qshell, this will also be true.  I 
assume on OS/400 you are kicking off the client program from CL command line.  

This will be fixed.

> Wrong definition of INVALID_SOCKET for non MS Windows platforms.
> ----------------------------------------------------------------
>
>          Key: AXISCPP-847
>          URL: http://issues.apache.org/jira/browse/AXISCPP-847
>      Project: Axis-C++
>         Type: Bug
>   Components: Transport (axis3)
>     Versions: 1.5 Final
>  Environment: i5/OS (OS/400 iSeries) and *nix (Linux and others)
>     Reporter: Ernst Mikkelsen
>     Priority: Critical

>
> In HTTPChannel.hpp and HTTPSSLChannel.hpp, INVALID_SOCKET is defined as 0 
> (zero). This causes a client using Axis C++ to fail consequently with a 
> HTTPTransportException on the first connection attempt on the i5/OS, because 
> 0 (zero) in fact is a valid socket descriptor on the i5/OS platform (as well 
> as it is on other platforms such as Linux). This also means that real errors 
> are not caught because -1 from the API is compared with to a 0 (zero).
> To my knowledge, all platforms defines socket() to return either -1 or ~0 
> depending on whether socket() is implemented with a signed or unsigned return 
> value.
> My suggestion would be to change the following two files:
>   HTTPChannel.hpp    line 56 in Axis C++ 1.5 Final
>   HTTPSSLChannel.hpp line 58 in Axis C++ 1.5 Final
>   from: const unsigned int INVALID_SOCKET =  0;
>   to:   const unsigned int INVALID_SOCKET = ~0;  // for unsigned socket() 
> implementations
>   or:   const          int INVALID_SOCKET = -1;  // for signed socket() 
> implementations
> As a workaround for this issue, I've tried to allocate a dummy socket in my 
> client program before calling any of the Axis C++ methods, causing Axis C++ 
> to succeed on the first connection attempt.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to