Bug 964 - Implementation of system.net.networkinformation.ping Class
Summary: Implementation of system.net.networkinformation.ping Class
Alias: None
Product: iOS
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 4.x
Hardware: Other Mac OS
: --- enhancement
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
: 1601 ()
Depends on:
Reported: 2011-09-21 12:42 UTC by Johan Wiersma
Modified: 2016-02-04 17:16 UTC (History)
8 users (show)

Is this bug a regression?: ---
Last known good build:

socketConnect (2.00 KB, application/octet-stream)
2011-10-21 07:56 UTC, Joseph Hill

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 964 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Johan Wiersma 2011-09-21 12:42:11 UTC
At the moment, using system.net.networkinformation.ping class in Monotouch does not seem to be working correctly. The class can be used, code will compile and build, the code runs without errors, but it does not function correctly, e.g. ip adresses that don't exist, return a valid reply status when pinged.

Environment used:
Xcode 3.6, MonoDevelop 2.6, Mono framework 2.10.5, MonoTouch 4.0.7
Comment 1 Sebastien Pouliot 2011-09-21 13:20:14 UTC

I'm unsure why Ping was added to the MonoTouch profile (it was not in Silverlight). I guess it came as a "shared" update for Mono for Android ? Anyway we should remove it from MonoTouch profile if it cannot work (like mentioned in the old bug report).
Comment 2 Sebastien Pouliot 2011-10-20 11:38:48 UTC
*** Bug 1601 has been marked as a duplicate of this bug. ***
Comment 3 Joseph Hill 2011-10-21 07:56:23 UTC
Created attachment 747 [details]

Customer provided alternative
Comment 4 baramuse 2012-11-21 19:35:48 UTC
I've done some research about it and it seems that that main assumption that blocks the implementation of Ping() on iOs (= the need of RAW level socket to perform a ICMP request) seems to be incorrect :

From apple documentation : 
On most platforms ping requires privileges (it's implemented with a raw IP socket). Mac OS X 10.2 and later, and all versions of iOS, include a special facility that allows you to ping without privileges. Specifically, you can open a special, non-privileged ICMP socket that allows you to send and receive pings.

Details here : http://forums.xamarin.com/discussion/410/ping-in-monotouch-icmp-requests

Comment 5 Paul Knopf 2013-10-29 18:14:01 UTC
SimplePing, which Apple says works for iOS (and indeed it does) is now available for MonoTouch via some bindings.

Comment 6 Xeonios 2014-12-27 22:26:00 UTC
The same thing is observed on Mac OS X 10.8.5 with Mono 3.10.
Comment 7 Xeonios 2014-12-27 22:38:25 UTC
The problem can be solved if you use a "sudo" command (sudo mono app.exe) in terminal, but it is not very convenient.