diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/IpNeighbourMonitor.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/IpNeighbourMonitor.kt index 6f5f7427..1ef0ccab 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/IpNeighbourMonitor.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/IpNeighbourMonitor.kt @@ -71,12 +71,12 @@ class IpNeighbourMonitor private constructor() : Runnable { } } monitor.waitFor() + if (monitor.exitValue() == 0) return@thread + Log.w(TAG, "Failed to set up monitor, switching to polling") + val pool = Executors.newScheduledThreadPool(1) + pool.scheduleAtFixedRate(this, 1, 1, TimeUnit.SECONDS) + this.pool = pool } catch (ignore: InterruptedIOException) { } - if (monitor.exitValue() == 0) return@thread - Log.w(TAG, "Failed to set up monitor, switching to polling") - val pool = Executors.newScheduledThreadPool(1) - pool.scheduleAtFixedRate(this, 1, 1, TimeUnit.SECONDS) - this.pool = pool } }