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=-2.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f7061427cd055975 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!usenet-fr.net!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Duncan Sands Newsgroups: comp.lang.ada Subject: Re: Using Check_Selector ... Date: Tue, 01 Mar 2005 12:01:06 +0100 Organization: Cuivre, Argent, Or Message-ID: References: <1109674151.141839.96860@l41g2000cwc.googlegroups.com> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1109674937 27948 212.85.156.195 (1 Mar 2005 11:02:17 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Tue, 1 Mar 2005 11:02:17 +0000 (UTC) Cc: comp.lang.ada@ada-france.org To: mferracini Return-Path: In-Reply-To: <1109674151.141839.96860@l41g2000cwc.googlegroups.com> X-Mailer: Evolution 2.0.2 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:8562 Date: 2005-03-01T12:01:06+01:00 > 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.