Cached channels are checked to see if they are alive before being returned

This commit is contained in:
Cyberboss
2017-09-27 13:19:53 -04:00
parent 2cd8181ed2
commit 596cf1d756
+4 -1
View File
@@ -135,7 +135,10 @@ namespace TGServiceInterface
if (ChannelFactoryCache.ContainsKey(tot))
try
{
return ((ChannelFactory<T>)ChannelFactoryCache[tot]).CreateChannel();
cf = ((ChannelFactory<T>)ChannelFactoryCache[tot]);
if (cf.State != CommunicationState.Opened)
throw new Exception();
return cf.CreateChannel();
}
catch
{