From: Ching Bon Lam <holyhuora@hotmail.commmm>
Subject: GNAT.Sockets.Check_Selector
Date: 01 Feb 2003 18:13:31 GMT
Date: 2003-02-01T18:13:31+00:00 [thread overview]
Message-ID: <Xns9315C4231E784holyhuorahotmailcomm@194.109.133.20> (raw)
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);
-- <snip> 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
---------------------------------------
next reply other threads:[~2003-02-01 18:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-01 18:13 Ching Bon Lam [this message]
2003-02-01 18:56 ` GNAT.Sockets.Check_Selector Ching Bon Lam
2003-02-01 19:35 ` GNAT.Sockets.Check_Selector Pascal Obry
2003-02-01 20:40 ` GNAT.Sockets.Check_Selector Ching Bon Lam
2003-02-02 9:29 ` GNAT.Sockets.Check_Selector Pascal Obry
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox