I think you might start by using GNAT.Sockets.Socket_Set_Type
to hold the sockets of interest, which are the server socket and all the currently connected client sockets.
Use GNAT.Sockets.Check_Selector
to wait until something readable happens, then GNAT.Sockets.Get
to find the socket (or one of the sockets) concerned; if it’s the server socket, then a new client has connected, otherwise one of the existing clients has input to read.
I’ve an example of this approach in my Embedded Web Server; but note this doesn’t deal with the case where one of the clients responds so slowly that writes get blocked. Recovering from that sort of situation would be more complex.