public virtual void OnSessionShutdown(ShutdownEventArgs reason) { m_connection.ConnectionShutdown -= new ConnectionShutdownEventHandler(this.OnConnectionShutdown); SessionShutdownEventHandler handler; lock (m_shutdownLock) { handler = m_sessionShutdown; m_sessionShutdown = null; } if (handler != null) { handler(this, reason); } }
public virtual void OnSessionShutdown(ShutdownEventArgs reason) { //Console.WriteLine("Session shutdown "+ChannelNumber+": "+reason); m_connection.ConnectionShutdown -= new ConnectionShutdownEventHandler(this.OnConnectionShutdown); SessionShutdownEventHandler handler; lock (m_shutdownLock) { handler = m_sessionShutdown; m_sessionShutdown = null; } if (handler != null) { handler(this, reason); } }