在单点触控中ping [英] ping in monotouch

查看:128
本文介绍了在单点触控中ping的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道为什么某些单点触控功能在模拟器中可以正常运行,但在真实设备上却无法运行? 相同的Ping班.它可以从模拟器完美运行,但无法在设备上运行.有什么区别?有没有办法让它在设备上运行?

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?

此外,我发现了这篇有关如何在Mac OS中实现ping的文章: http://developer.apple.com/library/mac/#samplecode/SimplePing/Listings/SimplePing_m.html#//apple_ref/doc/uid/DTS10000716-SimplePing_m-DontLinkElementID_5

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

是否可以将此代码移植到monotouch?老实说,我还没有尝试过它是否可以在iOS上运行,但是我看不到为什么它不能在iOS上运行.

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.我了解Reachability类,是的,我确实在我的项目中使用它,而不是ping!

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

推荐答案

这很可能与iOS允许您执行的操作有关.

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

这里来自一个试图使用原始套接字实现ping的人, iOS限制.

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

原始错误报告指出:执行ping操作需要Linux内核功能(capget)或设备上不存在的ping二进制文件."换句话说:根访问.

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.

此处是一种解决方法,但不是ping实现

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

也就是说,看起来有人试图将 SimplePing示例成功移植到iOS ,所以也许毕竟是可能的-但研究它并不是优先考虑的事情(毕竟Reachability类可用).

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).

这篇关于在单点触控中ping的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆