public void Dispose() { if (NetEventSource.IsEnabled) { NetEventSource.Info(this, $"timeout = {_closeTimeout}"); NetEventSource.Enter(this); } Dispose(true); GC.SuppressFinalize(this); if (NetEventSource.IsEnabled) NetEventSource.Exit(this); }
/// <summary> /// 停止服务 /// </summary> public void Dispose() { if (socket != null) { #if DotNetStandard AutoCSer.Net.TcpServer.CommandBase.CloseServer(socket); #else socket.Dispose(); #endif socket = null; } }