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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cb6679e1d5113fe3,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-01 10:12:27 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!transit.news.xs4all.nl!rhinewceros.xs4all.nl!not-for-mail Newsgroups: comp.lang.ada Subject: GNAT.Sockets.Check_Selector From: Ching Bon Lam Message-ID: User-Agent: Xnews/5.04.25 Date: 01 Feb 2003 18:13:31 GMT NNTP-Posting-Host: 213.84.97.6 X-Trace: 1044123211 dreader4.news.xs4all.nl 118 213.84.97.6:46620 Xref: archiver1.google.com comp.lang.ada:33678 Date: 2003-02-01T18:13:31+00:00 List-Id: Hi I've a problem. I've written a small program to test GNAT.Sockets.Check_Selector. After I've executed the program it immediately returns with a constraint error: raised CONSTRAINT_ERROR : g- socket.adb:538. I think the selector_type is raising this. If it doesn't return a constraint error it will run, however, Check_Selector returns immediately and Accept_Socket will block instead of accepting a socket that is ready. Any suggestions/answers/solutions to this is very appreciated. With regards, CBL ----------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Ada.Streams; use Ada.Streams; with GNAT.Sockets; use GNAT.Sockets; procedure prototype1 is Selector : Selector_Type; RSet, WSet : Socket_Set_Type; Address : Sock_Addr_Type; CAddr : Sock_Addr_Type; S : Socket_Type; C : Socket_Type; Status : Selector_Status; begin GNAT.Sockets.Initialize; Address.Addr := Any_Inet_Addr; Address.Port := 411; Create_Socket(S); Create_Socket(C); Bind_Socket(S, Address); Listen_Socket(S); Empty(RSet); Empty(WSet); Set(RSet, S); Create_Selector(Selector); loop Check_Selector(Selector, RSet, WSet, Status, Forever); Put_Line("Status: " & Selector_Status'Image(Status)); Put_Line("Accepting"); Accept_Socket(S, C, CAddr); -- do something with socket Close_Socket(C); end loop; Close_Selector(Selector); GNAT.Sockets.Finalize; end prototype1; --------------------------------------- Ching Bon Lam - Applied Phyiscs Student c.lam@student.utwente.nl ---------------------------------------