Check if another device is alive on the network based on its IP-address

隐身守侯 提交于 2020-01-17 05:38:27

问题


I'm trying to write a simple UWP IoT App that is to run on Windows 10 IoT Core on a Raspberry Pi.

The App need to test if another device is currently alive on the local network. All the Apps knows about this other device is its ip address.

I see from other SO questions that Ping is not supporten because ICMP is not supported on WinRT. I assume this also the case on UWP?

I guess I could create a socket and try an connect to for example port 80 and unless a time-out error is received then that means the device is available. However that "hack" seems a bit messy and I'm not sure that it would be solid enough to rely on.

Any other ideas for some C# UWP code that can be used for testing that a device is available and alive on a local network based on its ip address?


回答1:


You are correct, ICMP is still not supported on UWP. But you could use this instead: https://github.com/christophwille/winrt-vasily (it's kind-of what you wanted to do, but already done)



来源:https://stackoverflow.com/questions/33319301/check-if-another-device-is-alive-on-the-network-based-on-its-ip-address

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