c# - Find out if server is running, asp.net -


i have server , website running 100% fine.

the thing is, want website show on default page "status" of server. thinking pinging server code:

uri url = new uri("http://www.abhigrgrgrgrgsheksur.com"); string pingurl = string.format("{0}", url.host); string host = pingurl; bool result = false; ping p = new ping(); try {     pingreply reply = p.send(host, 3000);     if (reply.status == ipstatus.success)         return true; } catch { } return result; 

the code website found online, not mine.

the thing is, if put code on default page on website, when people "reverse" pings server, question is, can drop server? or stop working? or that? server not website. it's running process (minecraft server).

if understood correctly worried on every refresh of page ping , multiple ping call made

so statement made in remarks paragraph ping class @ http://msdn.microsoft.com/en-us/library/system.net.networkinformation.ping.aspx might concern

you cannot use same instance of ping class generate multiple simultaneous icmp echo requests. calling send while sendasync call in progress or calling sendasync multiple times before previous calls have completed causes invalidoperationexception.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -