private void XmppConnectionClose(object sender, XmppConnectionCloseEventArgs e) { var connection = (IXmppConnection)sender; connection.XmppStreamStart -= XmppConnectionXmppStreamStart; connection.XmppStreamElement -= XmppConnectionXmppStreamElement; connection.XmppStreamEnd -= XmppConnectionXmppStreamEnd; connection.Closed -= XmppConnectionClose; connectionListenerMap.Remove(connection.Id); }
private void XmppConnectionClosed(object sender, XmppConnectionCloseEventArgs e) { var connection = (IXmppConnection)sender; if (connection != null) { connection.Closed -= XmppConnectionClosed; connections.TryRemove(connection.Id, out connection); } }
private void XmppConnectionClosed(object sender, XmppConnectionCloseEventArgs e) { try { locker.EnterWriteLock(); var connection = (IXmppConnection)sender; connection.Closed -= XmppConnectionClosed; connections.Remove(connection.Id); } finally { locker.ExitWriteLock(); } }