From e53707c481dea15ade9d02eeab6c23d18d5f8a04 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 25 Oct 2016 15:35:09 -0700 Subject: [PATCH] Update GRPCHost comments --- src/objective-c/GRPCClient/private/GRPCHost.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m index c41cb81ee17..0524472f530 100644 --- a/src/objective-c/GRPCClient/private/GRPCHost.m +++ b/src/objective-c/GRPCClient/private/GRPCHost.m @@ -56,8 +56,9 @@ NS_ASSUME_NONNULL_BEGIN static NSMutableDictionary *kHostCache; // This connectivity monitor flushes the host cache when connectivity status -// changes. Otherwise, a new call might still use the cached channel which is -// no longer available and will call gRPC to hang +// changes or when connection switch between Wifi and Cellular data, so that a +// new call will use a new channel. Otherwise, a new call will still use the +// cached channel which is no longer available and will cause gRPC to hang. static GRPCConnectivityMonitor *connectivityMonitor = nil; @implementation GRPCHost { @@ -110,7 +111,7 @@ static GRPCConnectivityMonitor *connectivityMonitor = nil; _secure = YES; kHostCache[address] = self; } - // Keep a single monitor to flush the cache if the connectivity status changed + // Keep a single monitor to flush the cache if the connectivity status changes // Thread safety guarded by @synchronized(kHostCache) if (!connectivityMonitor) { connectivityMonitor =