Sorry folks, I wasn't paying attention. My problem was, the CONNECT API call was timing out and I felt zero as the socket descriptor might be the reason. Of course, that isn't the case.
The server IP address was being passed in Pic 9(8) Binary variable as shown in the manual. Since the passed value in decimal was exceeding the Pic size, truncation happened and the passed server IP address became invalid. I changed the variable with Comp-5 and all is well. Another pair of sharp eyes in our office detected this. I will be more diligent the next time. Nagesh On Thu, Oct 14, 2010 at 7:06 PM, Charles Mills <[email protected]> wrote: > 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:[email protected]] On > Behalf > Of McKown, John > Sent: Thursday, October 14, 2010 5:52 AM > To: [email protected] > Subject: Re: EZASOKET returns zero for socket descriptor in SOCKET call. > > > > > -----Original Message----- > > From: IBM Mainframe Discussion List > > [mailto:[email protected]] On Behalf Of ?????? ??????????? > > (Nagesh S) > > Sent: Thursday, October 14, 2010 1:17 AM > > To: [email protected] > > 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 [email protected] with the message: GET IBM-MAIN INFO > Search the archives at http://bama.ua.edu/archives/ibm-main.html > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

