2

Is it possible to run a TCP Ping in Silverlight? I know raw sockets are not allowed, which is a big limit. But can you achieve something similar to speedtest.net which does a ping utilizing Flash?

webly
  • 327
  • 2
  • 7
  • 18
  • 1
    Ping is implemented via the ICMP protocol, not TCP. You might want to search for ways to implement ICMP to better solve your issue. –  Dec 12 '09 at 15:44
  • Ping can be implemented through ICMP or TCP. I have done the search, the problem is that silverlight's system.net is more limited than .net framework system.net – webly Dec 12 '09 at 16:04
  • Can you provide a link for ping on TCP? – Jason Jackson Dec 13 '09 at 04:03

1 Answers1

2

It depends on what you're wanting to do. If you want to do a "real" ping, i.e., using ICMP, no you can't. But if you just want to know whether you're connected to the Internet in some fashion, or if some server is online, you could use the WebClient classes to see if a given web server responds, or if you control the server, you could use the Socket classes to try to open up a connection to a Silverlight-accessible port.

Ken Smith
  • 20,305
  • 15
  • 100
  • 147
  • That is such a cop-out for Microsoft. ICMP PING is light weight, there is a tremendous amount of overhead in setting up a TCP connection just to see if something is there. – Joel Mussman Aug 09 '23 at 13:09