|
|
@ -100,10 +100,8 @@ static GRPCConnectivityMonitor *connectivityMonitor = nil; |
|
|
|
_address = address; |
|
|
|
_address = address; |
|
|
|
_secure = YES; |
|
|
|
_secure = YES; |
|
|
|
kHostCache[address] = self; |
|
|
|
kHostCache[address] = self; |
|
|
|
|
|
|
|
} |
|
|
|
// When there is host in the cache, keep a single monitor to the network |
|
|
|
// Keep a single monitor to flush the cache if the connectivity status changed |
|
|
|
// to |
|
|
|
|
|
|
|
// flush the cache if the connectivity status changed |
|
|
|
|
|
|
|
if (!connectivityMonitor) { |
|
|
|
if (!connectivityMonitor) { |
|
|
|
connectivityMonitor = |
|
|
|
connectivityMonitor = |
|
|
|
[GRPCConnectivityMonitor monitorWithHost:hostURL.host]; |
|
|
|
[GRPCConnectivityMonitor monitorWithHost:hostURL.host]; |
|
|
@ -114,7 +112,6 @@ static GRPCConnectivityMonitor *connectivityMonitor = nil; |
|
|
|
wifiStatusChangeHandler:handler]; |
|
|
|
wifiStatusChangeHandler:handler]; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return self; |
|
|
|
return self; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -125,8 +122,6 @@ static GRPCConnectivityMonitor *connectivityMonitor = nil; |
|
|
|
BOOL * _Nonnull stop) { |
|
|
|
BOOL * _Nonnull stop) { |
|
|
|
[host disconnect]; |
|
|
|
[host disconnect]; |
|
|
|
}]; |
|
|
|
}]; |
|
|
|
[kHostCache removeAllObjects]; |
|
|
|
|
|
|
|
connectivityMonitor = nil; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|