comp.lang.ada
 help / color / mirror / Atom feed
From: Duncan Sands <baldrick@free.fr>
To: mferracini <maurizio.ferracini@gmail.com>
Cc: comp.lang.ada@ada-france.org
Subject: Re: Using Check_Selector ...
Date: Tue, 01 Mar 2005 12:01:06 +0100
Date: 2005-03-01T12:01:06+01:00	[thread overview]
Message-ID: <mailman.157.1109674936.527.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: <1109674151.141839.96860@l41g2000cwc.googlegroups.com>

>       Accept_Socket (Server, Socket, Address);
>       Ada.Text_Io.Put_Line ("new connection");
>       Set(Rset, Socket);

You should do this "Set (Rset, ...)" every time around the loop (and
clear the write set).  After all, if the selector times out the
Rset will be empty, and then you loop around and check the
selector with an empty Rset...

>       Create_Selector(Selector);
> 
>       begin
>          loop
>             Check_Selector(Selector, Rset, Wset, Status, 0.5);
>             if (Status /= Expired ) then
>                Receive_Socket(Socket,Message,Last);
>                Ada.Text_Io.Put_Line("read something");
>             else
>                Ada.Text_Io.Put(".");
>             end if;
>          end loop;
>       end;

All the best,

Duncan.




  reply	other threads:[~2005-03-01 11:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-01 10:49 Using Check_Selector mferracini
2005-03-01 11:01 ` Duncan Sands [this message]
2005-03-01 11:25   ` mferracini
replies disabled

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