private void CloseChannel(IClientDataphorService channel) { try { ICommunicationObject localChannel = (ICommunicationObject)channel; if (localChannel.State == CommunicationState.Opened) { localChannel.Close(); } else { localChannel.Abort(); } } catch { // Ignore exceptions here, there's nothing we can do about it anyway. } }
private bool IsChannelValid(IClientDataphorService channel) { return(((ICommunicationObject)channel).State == CommunicationState.Opened); }