ping in monotouch

I'm wondering why does some monotouch features works well in simulator but fails on real device? the same Ping class. it works perfectly from simulator but fails on the device. What is the difference? it there a way to make it work on device?

More over, I've found this article on how to implement ping in mac OS: http://developer.apple.com/library/mac/#samplecode/SimplePing/Listings/SimplePing_m.html#//apple_ref/doc/uid/DTS10000716-SimplePing_m-DontLinkElementID_5

will it be possible to port this code to monotouch? being honest, I havent yet tried if it works on iOS, but I dont see anything why wouldn't it work there.

PS. I know about Reachability class, and yes, I do use it in my projects instead of ping!

Answers


This is most likely an issue with what iOS allows you to do.

Here is from one guy who tried to implement ping using raw sockets, and ran into iOS restrictions.

The original bugreport states that: "To do a ping requires a linux kernel capability (capget) or the ping binary on the device which doesn't exist." In other words: root access.

Here is a workaround, but it's not a ping implementation.

That said, it looks like somebody tried to port the SimplePing sample to iOS with success, so maybe it is possible after all - but it just hasn't been a priority to look into it (the Reachability class is after all available).


Need Your Help

eclipse debugger - breakpoint when exception is thrown on a specific place

java eclipse debugging exception-handling

Is it possible to break execution in the debugger of eclipse when exception is thrown on a specific line or in a specific class?

How to execute commands? via singleton utility method or via OnPropertyChanged?

c# wpf mvvm

Assume one of the ViewModel receive some command that is pretty general to application (and can be also executed from other ViewModels, for example "stop ftp server"). What should i do?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.