It'd be a Good Idea not to include the contents of your bin/ and obj/
directories in your checked-in items! They're useless to anyone who
clones the repo (unless they're running the same OS and compiler as you,
of course, but that's unlikely).
gnatmake's -p switch is your friend (create any needed directories if
necessary).
Actually I see you have obj/doc/, shouldn't that be just doc/?
Looking at TCP.Server.Client_Type (in V2), you have
task body Client_Type is
Stream : Sockets.Stream_Access;
begin
loop
accept Set_Stream (S : in Sockets.Stream_Access) do
Stream := S;
end Set_Stream;
accept Write (Message : in String) do
String'Output ( Stream, Message );
end Write;
accept Read (Message : out String) do
Message := String'Input ( Stream );
end Read;
end loop;
end Client_Type;
which won't do what you want; every pass through the loop the task waits
for a call on Set_Stream, then on Write ... you need something more like
task body Client_Type is
Stream : Sockets.Stream_Access;
begin
-- Must have a stream before anything else
accept Set_Stream (S : in Sockets.Stream_Access) do
Stream := S;
end Set_Stream;
loop
select
accept Write (Message : in String) do
String'Output ( Stream, Message );
end Write;
or
accept Read (Message : out String) do
Message := String'Input ( Stream );
end Read;
end select;
end loop;
end Client_Type;
> 2. How can I know if one client has been disconnected?
If you try to write to it and get a Socket_Error; or if you try to read
from it and get a successful completion with zero bytes read (or, of
course, a Socket_Error; but I think that'll only happen if you've closed
the server end).
Q. How do you know whether to try to read from the socket?
A. Use GNAT.Sockets.Selector_Type and Check_Selector().