comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: Aborting a call to Accept_Socket
Date: Tue, 21 Apr 2009 14:03:01 -0700 (PDT)
Date: 2009-04-21T14:03:01-07:00	[thread overview]
Message-ID: <22732da9-5129-4de4-8690-5eea24805b82@y9g2000yqg.googlegroups.com> (raw)
In-Reply-To: 44d6b044-3cb8-402c-9b1f-afe39f6a47ce@r33g2000yqn.googlegroups.com

On 21 Kwi, 17:40, Tony <truand.t...@gmail.com> wrote:
> I would like to abort a call to Accept_Socket() if no connection
> request arrives within a specified time (20 seconds).

Then you want to use the selector with timeout.
In order to wait for the listening socket put it in the "reading"
selector set.
If the Check_Selector finishes with the Status equal to Completed, it
means that you can call Accept_Socket without blocking, because there
is an incoming connection pending. Otherwise the timeout has expired,
which means that there was no incoming connection during the given
time.

> For me, a quite
> simple solution (perhaps not safe) is to use an asynchronous transfer
> of control

Unfortunately there is no integration of ATC and I/O.
Expecially when it comes to non-standard I/O.

--
Maciej Sobczak * www.msobczak.com * www.inspirel.com

Database Access Library for Ada: www.inspirel.com/soci-ada



  parent reply	other threads:[~2009-04-21 21:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-21 15:40 Aborting a call to Accept_Socket Tony
2009-04-21 16:21 ` Dmitry A. Kazakov
2009-04-21 16:32   ` Tony
2009-04-21 17:34   ` Adam Beneschan
2009-04-21 19:02     ` sjw
2009-04-21 21:03 ` Maciej Sobczak [this message]
2009-04-21 23:24 ` anon
replies disabled

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