Home Forums Support Loop through connected clients. Reply To: Loop through connected clients.


Heya Mussie,

Thanks for your interest in our library and welcome to our forums.

How can I loop through each connected clients to check if they are alive?

//Loop over every connection and check the alive state
foreach (Connection conn in NetworkComms.GetExistingConnection())
    //If true the remote end of the connection responded to an alive/ping test
    if (conn.ConnectionAlive())
        Console.WriteLine("Connection with {0} is alive", conn.ToString());
        Console.WriteLine("Connection with {0} is dead", conn.ToString());

Kind regards,