Merge pull request #217 from Cyberboss/DeadChannels

Cached channels are checked to see if they are alive before being returned
This commit is contained in:
Jordan Brown
2017-09-27 13:22:42 -04:00
committed by GitHub
+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
{