locked
C# - Ping-equivalent method in Compact Framework RRS feed

  • Question

  • Hello,

    Is there a ping-equivalent class in Compact Framework for .Net Framework 2.0?

    I have written a FTP Client program that connects to a remote server using the Socket class. Unfortunately, I could not find a suitable way to periodically check to see if the remote server is still connected to the Client using the Socket class. Aside from sending a packet to the remote server via the socket and triggering an exception error, I could not find any other ways to check the remote server connection.

    Hence, I considered using the ping method but my driver is written in Compact Framework and it does not support the ping class.

    Hope to get some input on this.

    Thanks!

    Best Regards,
    Monday, March 31, 2008 9:13 AM

Answers

All replies

  • Ping is not available in the compact framework; however, this codeproject article discusses how to roll your own:

     

    http://www.codeproject.com/KB/cpp/PINGCONTROL.aspx

     

    Hope this helps....

    Monday, March 31, 2008 12:49 PM
  • Hi John,

    Thanks for the feedback!

    I looked through the sample code and found out that it is still using the Socket class to send a packet and wait for a response. Aside from this method, I am wondering if there are any other ways of checking the remote connection.

    Thanks,

    Best Regards





    Tuesday, April 1, 2008 2:04 AM
  • There is no Ping class in the .NET Compact Framework, but you can use the OpenNETCF.Net.NetworkInformation.Ping class in the SDF if you don't intend to implement it yourself.

     

    Wednesday, April 2, 2008 5:23 AM
  • Thanks, I will look into the OpenNETCF solution.
    Friday, April 4, 2008 6:26 AM
  • Hi but this  OpenNETCF.Net.NetworkInformation.Ping  is free ?  or i have to pay to use this class ?

     

    Best regards Paolo


    Chilean guy
    Sunday, November 7, 2010 5:06 PM