public virtual void CloseConnection() { IConnectionListener connListener; ServerManager connManager; lock (this.connMutex) { lock (this.stateMutex) { if (this.connManager == null) { return; } this.phase++; connManager = this.connManager; connListener = this.connListener; } this.connManager = null; this.connListener = null; } foreach (ITableManager manager2 in connManager.Close()) { manager2.NotifyUnsub(); } try { connListener.OnClose(); } catch (Exception) { } }
public virtual void OnClosed(IConnectionListener closedListener) { NotificationQueue.Notify fun = null; lock (this) { this.failed = true; if (closedListener != null) { if (fun == null) { fun = delegate { closedListener.OnClose(); }; } this.queue.Add(fun); } this.queue.End(); } }