[3.1.0]reject the stop and restart of socket

This commit is contained in:
zhongchao
2023-04-18 16:43:12 +08:00
parent f8ebfe416c
commit bc2a57e05e

View File

@@ -52,10 +52,11 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
private var context: Context? = null
@Volatile
private var gotToken = false
private var httpDnsSimpleLocation by Delegates.observable(getDefaultSimpleLocation()) { _, oldValue, newValue ->
if (oldValue.cityCode != newValue.cityCode) {
if (gotToken && oldValue.cityCode != newValue.cityCode) {
reConnectSocket(oldValue.cityCode, newValue.cityCode)
}
}