I want to check a server if it is alive or not without using Ping() method.
Are there any solutions to to that?
At the current the method below is ok to me.
public static bool PingToServer(string ipServer)
{
bool isServerLife = false;
try
{
Ping ping = new Ping();
PingReply pingReply = ping.Send(ipServer, 5000);
if (pingReply.Status == IPStatus.Success)
{
isServerLife = true;
}
}
catch (Exception e)
{
Console.Write("PingToServer: Cannot ping to server, " + e.Message);
}
return isServerLife;
}