From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,20324ebb3709048c X-Google-Attributes: gid103376,public From: Florian Weimer Subject: Re: Terminate program in Ada95 Date: 2000/11/27 Message-ID: <87itp92kd9.fsf@deneb.enyo.de>#1/1 X-Deja-AN: 698387215 References: <975328139.872809@edh3> <3A226987.325D7B24@mail.com> Organization: Enyo's not your organization Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-11-27T00:00:00+00:00 List-Id: Mats Weber writes: > If it is UNIX or UNIX-like (which it probably is if you are using > sockets) then you can close the sockets with pending I/O operations from > outside the task doing the socket I/O. This will make any pending > opertion on the socket exit with an error code that is hopefully handled > in the task. This might introduce a race condition because the file descriptor used by the socket might be reused soon. I think the shutdown socket operation is better than simply closing the socket under these circumstances (it will cause subsequent operations on the socket to fail, but doesn't release the file descriptor at once).