I have seen the same "problem." I ported some Windows socket code to z/OS.
The Windows code treated a return of <= 0 as an error. However, the
documentation states that a return of less than zero indicates an error.
Changing it to check for < 0 was an easy fix, and the code remained portable
back to Windows, as apparently Winsock never returns a zero at all.

 

Return values A nonnegative socket descriptor indicates success. The value
-1 indicates an error. Errno identifies the specific error.

 

You should treat the socket number as a magic cookie - its numeric value has
no significance, it's only a magic token - just so long as it is not less
than zero.

 

Charles

From: IBM Mainframe Discussion List [mailto:ibm-m...@bama.ua.edu] On Behalf
Of McKown, John
Sent: Thursday, October 14, 2010 5:52 AM
To: IBM-MAIN@bama.ua.edu
Subject: Re: EZASOKET returns zero for socket descriptor in SOCKET call.

 

> -----Original Message-----
> From: IBM Mainframe Discussion List
> [mailto:ibm-m...@bama.ua.edu] On Behalf Of ?????? ???????????
> (Nagesh S)
> Sent: Thursday, October 14, 2010 1:17 AM
> To: IBM-MAIN@bama.ua.edu
> Subject: EZASOKET returns zero for socket descriptor in SOCKET call.
>
> Hi,
> For the SOCKET function in the EZASOKET call, I always get zero as the
> socket descriptor. This happens even when I am doing INITAPI




----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to