net.dankito.utils.network.PeriodicCheckingNetworkConnectivityManager.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-utils Show documentation
Show all versions of java-utils Show documentation
Some basic utils needed in many projects
package net.dankito.utils.network
import java.util.*
import kotlin.concurrent.schedule
open class PeriodicCheckingNetworkConnectivityManager(networkHelper: INetworkHelper)
: NetworkConnectivityManagerBase(networkHelper) {
companion object {
private const val CheckForNetworkInterfaceChangesPeriodMillis = 60 * 1000L
}
init {
Timer().schedule(CheckForNetworkInterfaceChangesPeriodMillis, CheckForNetworkInterfaceChangesPeriodMillis) { networkInterfacesChanged() }
}
}