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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,be3d89c2ad66a506 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!atl-c08.usenetserver.com!news.usenetserver.com!pc02.usenetserver.com!ALLTEL.NET-a2kHrUvQQWlmc!not-for-mail Date: Tue, 08 Nov 2005 10:42:27 -0600 From: "Marc A. Criley" User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Advice on abort References: <1131117934.372137.244900@g44g2000cwa.googlegroups.com> <436f6ad8$0$196$edfadb0f@dread11.news.tele.dk> <1131383393.903975.180350@g47g2000cwa.googlegroups.com> <1rb5pcog6iau7$.180ltiuk2q6cv.dlg@40tude.net> <4370bc36$0$180$edfadb0f@dread11.news.tele.dk> <1ozi307fng5fi$.1ms3kyzc7defi$.dlg@40tude.net> In-Reply-To: <1ozi307fng5fi$.1ms3kyzc7defi$.dlg@40tude.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <3e48f$4370d57e$49956e5$14388@ALLTEL.NET> X-Complaints-To: abuse@usenetserver.com Organization: UseNetServer.com X-Trace: 3e48f4370d57ea13cf34014388 Xref: g2news1.google.com comp.lang.ada:6289 Date: 2005-11-08T10:42:27-06:00 List-Id: Dmitry A. Kazakov wrote: > On Tue, 08 Nov 2005 15:54:45 +0100, Poul-Erik Andreasen wrote: > >>I am not that good at sockets, So i vould like to know wich problematic >>(uncleanable) states wee are taking about. > > > It all depends on the particular implementation of the socket library and > how Ada tasks are mapped to system threads and processes. All sorts of > resource leaks are thinkable. For example, you might be unable to listen > that TCP/IP port until process restart or it won't abort etc. When I decided to rework the DTraq socket interface to better handle disconnects, loss of comms, response timeouts, and application shutdown (and optimize its performance), I tried various approaches that included shutting down the socket from a different task and aborting the task that was listening on the socket. As the socket connection was for asynchronous communications, I could end up trying to break (or experiencing a break in) the connection while it was idling, or while it was in the midst of data receipt or data transmission. Most approaches worked most of the time, but I kept running into intermittent glitches. When I belatedly discovered the selector support in GNAT.Sockets, I went with that technique, with the result being no more glitches, and a much cleaner implementation. -- Marc A. Criley -- McKae Technologies -- www.mckae.com -- DTraq - XPath In Ada - XML EZ Out