How to manage client connections using GNAT.sockets?

This is a chat client / server program. To make a broadcast, I have to save each client that connects, and then write to each of them, right? What is the best practice for customer management?

    GNAT.Sockets.Accept_Socket(
         Server  => Receiver,
         Socket => Connection,
        Address => Client
    );
    Channel := GNAT.Sockets.Stream(Connection);
    String'Write(Channel, "Welcome Message");
+3
source share
2 answers

I think you can start with GNAT.Sockets.Socket_Set_Typeto hold the sockets of interest, which are the server socket and all client sockets connected to it.

GNAT.Sockets.Check_Selector, , - , GNAT.Sockets.Get, ( ); , , .

Embedded Web Server; , , , . .

+2

, . , .

- - .

, ZeroMQ TOMI_4_Ada /, pub/sub minutiae.

Ada , YAMI4, .

+2

All Articles