Rob and Giovanni, I've been watching this thread unravel. A dozen or so years ago when I was teaching myself C and socket programming I paraphrased the samples in the what is now the "z/OS Communications Server IP Sockets API Guide and Reference" manual. This included the 3 programs in what is now Appendix A of the manual, "Multitasking C socket sample program". This covers how to use getclientid(), givesocket() and takesocket(). Those are my credentials for jumping in. Incidentally, my rewrite of the programs worked just fine so I must have done it correctly.
The samples use the C "Multitasking Facility" (MTF) calls so at first I thought it was not possible to have the programs "taking" the socket run in a different address space. However, the description of the givesocket() call specifically mentions running in another address space - actually it's more mentions running in the same address space as being special. Straight away however, there's a testing suggestion which is not to specify the address space at all in the clientid structure name field used in the givesocket() call so that any address space can "take" the socket. This description of the givesocket() call indicates that the subtaskname field should be blank. I realise that you are using EZASMI macros in assembler rather than the C calls and structures but I would expect the API to operate in much the same way with the same rules. Thus the field you call TASK I presume corresponds to the subtaskname field and I see from an earlier post that you set a name here. Could this be a problem? I also appreciate that you talk about changing the program from using a subtask so you've had something working already. Having mentioned the assembler interface I took a look at the descriptions there in order to see if they were much different. In essence they are not although, unlike with the C descriptions, there is talk of setting the subtask fields, although again, they can be left blank. So why run before you can walk? Why not remove all these unnecessary name checks while you are testing? Set the CLIENTID structure fields blank - except for 2 in the DOMAIN field for AF_INET, of course - for the GIVESOCKET macro. Now all you need to do is provide that correct DOMAIN, correct address space NAME and a blank TASK name in the CLIENTID structure used by the TAKESOCKET macro together with the correct socket number and it should work. Incidentally, Rob, the manual doesn't seem to agree with all the "musts" in your second post in this thread. Chris Mason ----- Original Message ----- From: "Rob Scott" <[EMAIL PROTECTED]> Newsgroups: bit.listserv.ibm-main To: <[email protected]> Sent: Thursday, 15 June, 2006 11:26 PM Subject: Re: Writing a Listener and receive the takesocket in other address space > Giovanni > > Have you double-checked the DOMAIN setting? > > It would be very helpful if you posted the actual EZASMI macro > statements (INITAPI, GIVESOCKET and TAKESOCKET) from both programs and > the associated working storage. > > > Rob Scott > Rocket Software, Inc > 275 Grove Street > Newton, MA 02466 > 617-614-2305 > [EMAIL PROTECTED] > http://www.rs.com/portfolio/mxi/ > > > -----Original Message----- > From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On > Behalf Of Giovanni L Bozzetti > Sent: 15 June 2006 16:10 > To: [email protected] > Subject: Re: Writing a Listener and receive the takesocket in other > address space > > Rob, > > S LSTWORK.TASK0001,P1=00000001 this is the socket no, converted in > decimal and When received converted in > hex and saved in a half-word, I dump the memory in LSTWORK and > everything is ok X'0001'. I can see in the correct field. > > LSTSERVE receive the connection > execute the GIVESOCKET > start LSTWORK > remain in WAIT > CLOSE socket > return to ACCEPT > > LSTWORK receive PARMS > Alocate a Global area TCP/IP > Alocate task area > execute INITAPI > execute TAKESOCKET <== I didn't pass from > here??? > POST Cross-Memory > Enter in RECEIVE/SEND > > Giovanni Bozzetti > System Programmer > > ----- Original Message ----- > From: "Rob Scott" <[EMAIL PROTECTED]> > Newsgroups: bit.listserv.ibm-main > To: <[email protected]> > Sent: Thursday, June 15, 2006 3:55 PM > Subject: Re: Writing a Listener and receive the takesocket in other > address space > > > > How do you pass the socket number between the address spaces ? > > > > It might help if you posted some code fragments > > > > > > Rob Scott > > Rocket Software, Inc > > 275 Grove Street > > Newton, MA 02466 > > 617-614-2305 > > [EMAIL PROTECTED] > > http://www.rs.com/portfolio/mxi/ ---------------------------------------------------------------------- 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

