protected void ChatForm_FormClosing(object sender, FormClosingEventArgs e) { if (_proxy != null) { if (!string.IsNullOrEmpty(_userName) && IsConnected(_userName)) { Proxy.Disconnect(_userName); } while (_proxy.State == CommunicationState.Opened) { try { Proxy.Close(); } catch { } } Proxy = null; } }
protected void ChatForm_FormClosing(object sender, FormClosingEventArgs e) { if (_proxy != null) { if (!string.IsNullOrEmpty(_userName) && IsConnected(_userName)) Proxy.Disconnect(_userName); while (_proxy.State == CommunicationState.Opened) { try { Proxy.Close(); } catch { } } Proxy = null; } }