Tin Tran
09/29/2021, 7:30 AMinappropriate blocking method call
warning. Does anyone know why?
CoroutineScope(<http://Dispatchers.IO|Dispatchers.IO>).launch {
try {
network.socketFactory.createSocket().use {
it.connect(InetSocketAddress("8.8.8.8",53),1500)
validNetworks.add(network)
checkNetwork()
}
}
catch (e:Exception){
Timber.e(e)
}
}
Nicolas Chaduc
09/29/2021, 7:39 AMuse
? Did you need close the socket after end of checkNetwork()
?Tin Tran
09/29/2021, 7:40 AMeneim
09/29/2021, 9:12 AMlaunch
should be cancellable so that once the coroutine is canceled, the execution will be canceled gracefully. Please check your use of the socket and see if any part of it is not cancellable.Tin Tran
09/29/2021, 10:58 AMbaxter
09/30/2021, 1:58 AM