开发者

link state notification in Java

开发者 https://www.devze.com 2022-12-27 22:14 出处:网络
Is there any way in Java to receive event notifications whenever link state changes on a computer (connected, disconnected开发者_StackOverflow社区, up, down, etc)? Thanks!There is no platform-independ

Is there any way in Java to receive event notifications whenever link state changes on a computer (connected, disconnected开发者_StackOverflow社区, up, down, etc)? Thanks!


There is no platform-independent mechanism which accomplishes this in Java. However, you can use JNI to do it. For example, Windows allows you to poll (or be notified of) network interface states using the Network Location Awareness (NLA) API.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号