Skip to content

Commit

Permalink
ping watcher added
Browse files Browse the repository at this point in the history
  • Loading branch information
shohan-pherones committed Apr 7, 2023
1 parent d0abdfb commit c6b5f50
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions ping.config.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Net.NetworkInformation;

class Program
{
static void Main(string[] args)
{
string host = "http://locahost:3000"; // replace with the hostname or IP address to ping

Ping ping = new Ping();
PingReply reply = ping.Send(host);

if (reply.Status == IPStatus.Success)
{
Console.WriteLine("Ping to {0} successful. Time: {1}ms", host, reply.RoundtripTime);
}
else
{
Console.WriteLine("Ping to {0} failed. Status: {1}", host, reply.Status);
}

Console.ReadKey();
}
}

0 comments on commit c6b5f50

Please sign in to comment.