Home › Forums › Support › Loop through connected clients. › Reply To: Loop through connected clients.
December 6, 2013 at 16:04
#1284
Inactive
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());
else
Console.WriteLine("Connection with {0} is dead", conn.ToString());
}
Kind regards,
Marc
