From d8a9b76a6bb2824c1e9fb0d17938c926472dd78b Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期二, 03 二月 2026 13:44:27 +0800
Subject: [PATCH] 支持帧消息协议并改进 TCP 服务器
---
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.Dispose.cs | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.Dispose.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.Dispose.cs
index d8f5ec9..539df48 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.Dispose.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/SocketServer/TcpSocketServer.Dispose.cs
@@ -5,6 +5,11 @@
{
public partial class TcpSocketServer
{
+ /// <summary>
+ /// 释放服务器使用的所有资源并停止监听传入连接。
+ /// </summary>
+ /// <remarks>当不再需要服务器时调用此方法,以确保所有相关资源(如网络监听器和同步原语)被正确释放。
+ /// 调用 <see cref="Dispose"/> 后,服务器无法重新启动或再次使用。</remarks>
public void Dispose()
{
_cts?.Cancel();
--
Gitblit v1.9.3