comp.lang.ada
 help / color / mirror / Atom feed
From: "Marc A. Criley" <mcNOSPAM@mckae.com>
Subject: Re: Advice on abort
Date: Tue, 08 Nov 2005 10:42:27 -0600
Date: 2005-11-08T10:42:27-06:00	[thread overview]
Message-ID: <3e48f$4370d57e$49956e5$14388@ALLTEL.NET> (raw)
In-Reply-To: <1ozi307fng5fi$.1ms3kyzc7defi$.dlg@40tude.net>

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



  reply	other threads:[~2005-11-08 16:42 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-04 15:25 Advice on abort REH
2005-11-04 17:15 ` Marc A. Criley
2005-11-04 18:21 ` Dmitry A. Kazakov
2005-11-04 18:35   ` REH
2005-11-05 18:33   ` Simon Wright
2005-11-05 21:23     ` REH
2005-11-06 11:17       ` Simon Wright
2005-11-06 13:58         ` REH
2005-11-06 20:08           ` Simon Wright
2005-11-06 20:41             ` REH
2005-11-07 14:55 ` Poul-Erik Andreasen
2005-11-07 17:09   ` REH
2005-11-07 18:03     ` Dmitry A. Kazakov
2005-11-08 14:54       ` Poul-Erik Andreasen
2005-11-08 16:14         ` Dmitry A. Kazakov
2005-11-08 16:42           ` Marc A. Criley [this message]
2005-11-08 16:59           ` Poul-Erik Andreasen
2005-11-08 20:05             ` Dmitry A. Kazakov
2005-11-09 14:12               ` Poul-Erik Andreasen
2005-11-09 17:14                 ` Dmitry A. Kazakov
2005-11-08 16:32         ` Marc A. Criley
2005-11-08 14:35     ` Poul-Erik Andreasen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox