comp.lang.ada
 help / color / mirror / Atom feed
* Aborting a call to Accept_Socket
@ 2009-04-21 15:40 Tony
  2009-04-21 16:21 ` Dmitry A. Kazakov
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Tony @ 2009-04-21 15:40 UTC (permalink / raw)


I would like to abort a call to Accept_Socket() if no connection
request arrives within a specified time (20 seconds).  For me, a quite
simple solution (perhaps not safe) is to use an asynchronous transfer
of control like this:
--****************************************************
   procedure Server is
       ...
   begin
       GNAT.Sockets.Initialize;
       ...
       loop
           ...
           select
               delay 20.0;
               exit;
           then abort
               GNAT.Sockets.Accept_Socket (...);
           end select;
           ...
       end loop ;
   end Server;
--****************************************************
The expecting behaviour was the end of the program after 20 seconds
(if no connection request arrives). I observe : after 20 seconds the
program will terminate only if  a connection request arrives.
Is this behaviour correct?
Thanks.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-04-21 23:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2009-04-21 23:24 ` anon

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