/// <summary> /// 释放资源 /// </summary> /// <param name="disposing">是否也释放托管资源</param> protected virtual void Dispose(bool disposing) { if (this.IsListening == true) { this.listenSocket.Dispose(); } this.acceptArg.Dispose(); this.workSessions.Dispose(); this.freeSessions.Dispose(); this.middlewares.Clear(); if (disposing == true) { this.listenSocket = null; this.acceptArg = null; this.middlewares = null; this.workSessions = null; this.freeSessions = null; this.LocalEndPoint = null; this.IsListening = false; this.KeepAlivePeriod = TimeSpan.Zero; this.Events = null; } }
/// <summary> /// 调试视图 /// </summary> /// <param name="view">查看的对象</param> public SessionCollectionDebugView(TcpSessionCollection view) { this.view = view; }