简体   繁体   中英

Java Watchservice, how to reconnect to a watched directory when switching from Ethernet to Wi-Fi or vice versa?

Is there a solution on how to reestablish a connection to a watched directory when switching from Ethernet to Wireless, or vice versa without rebooting the laptop once the watch service starts? Is there a way to restart the watchservice every few minutes programmatically or is that even possible?

This is resolved. I figured it out. I'm batting 1000 fixing my own problems. Just call the main method within the loop.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM