Is it possible to implement ping on windows phone 7?

元气小坏坏 提交于 2019-12-23 10:49:25

问题


To get the impression of networking capabilities in WP7 I was going to build a simple ping app that would display the result of ICMP ping request to a certain host.

However, not only the System.Net.NetworkInformation.Ping class is missing, System.Net.Sockets namespace is missing as well.

After a short research I found out that there are only two ways of communication in WP7: WebClient class that works with http(s) requests and WCF-client that works with SOA services.

Does that mean that I can't ping hosts directly from the phone? The only possible solution I see is implementing a separate WCF service on a dedicated server that will do the pinging for the phone, which looks like an overkill and has certain flaws.


回答1:


You won't be able to do this until sockets come to the WP7 platform as there isn't going to be any other way to send an ICMP packet.

The phones may not respond to pings back from a server either - we'll have to see on that. If they don't I doubt there would be anyway to change this on unhacked devices.

Pinging to a target host from a server on behalf of a phone isn't going to be too helpful either since unfortunately it won't reflect the latency between phone and target host in any way.



来源:https://stackoverflow.com/questions/3273927/is-it-possible-to-implement-ping-on-windows-phone-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!