You could consider one (or both) of the following : (1) Use SELECTEX and an ECB that is posted when shutdown is requested (2) Use the ASYNC=ECB or ASYNC=EXIT option on the INITAPI service and then cover your SEND and RECV calls with extra ECBs for external (eg shutdown) requests
Cancelling the server and/or tolerating DETACH with SA03 seems rather ugly and could cause a load of connections hanging around in some sort of "FinWait" status. Rob Scott Lead Developer Rocket Software 77 Fourth Avenue . Suite 100 . Waltham . MA 02451-1468 . USA Tel: +1.781.684.2305 Email: [email protected] Web: www.rocketsoftware.com -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of Donald Likens Sent: 19 August 2014 22:02 To: [email protected] Subject: How to cleanly shutdown a socket server? 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 [email protected] with the message: INFO IBM-MAIN ================================ Rocket Software, Inc. and subsidiaries ■ 77 Fourth Avenue, Waltham MA 02451 ■ +1 800.966.3270 ■ +1 781.577.4321 Unsubscribe From Commercial Email – [email protected] Manage Your Subscription Preferences - http://info.rocketsoftware.com/GlobalSubscriptionManagementEmailFooter_SubscriptionCenter.html Privacy Policy - http://www.rocketsoftware.com/company/legal/privacy-policy ================================ ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
