Checkout selectx() in the IP sockets manual. It has extra parameter for an ECB list. The idea is to start two threads, one that listens for a shutdown command via EXTRACT/CIB etc and the other is the socket server. When you receive a shutdown event post the ECB that selectx() is waiting on and run your shutdown code. Of course, you may be processing data when the ECB is posted so you have to check the ECB before issuing selectx().

On 20/08/2014 5:02 AM, Donald Likens wrote:
I have been struggling with this for a while... Cancel always works but I don't 
think that is clean. I just looked in the IP Socket Interface guide hoping it 
would help but the design noted there has a task receiving data forever. I do 
not have a problem if the socket is busy. I can always set a switch and 
terminate. My problem is when the socket is idle. It is waiting for input and 
does not know it is to shutdown.

My most current idea is to setup a ESTAE to ignore SA03 abends and detach the 
task. I have not tested this yet but it seems unclean to me (even if externally 
it will look clean). I have also thought about setting a timeout value but I am 
concerned about using this. If the socket times out, do I have to close and 
reopen the socket? How long do I wait before I timeout? Does this cause a lot 
of overhead?

Have you created a socket server? Did you have a clean way of shutting it down? 
Please explain how. Thanks

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to