From 0fa137570bf7ac2bf58c8af2828cd595625fa400 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期日, 19 四月 2026 18:53:45 +0800
Subject: [PATCH] Merge branch 'dev' of http://115.159.85.185:8098/r/SuZhouGuanHong/ShanMeiXinNengYuan into dev
---
Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/WebSocketSetup.cs | 45 ++++++++++++++++++++++++++++++---------------
1 files changed, 30 insertions(+), 15 deletions(-)
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/WebSocketSetup.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/WebSocketSetup.cs
index 1c6b23a..f04b78e 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/WebSocketSetup.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/WebSocketSetup.cs
@@ -11,22 +11,37 @@
{
public static class WebSocketSetup
{
- public static void AddWebSocketSetup(this IServiceCollection services)
- {
- if (services == null) throw new ArgumentNullException(nameof(services));
+ //public static void AddWebSocketSetup(this IServiceCollection services)
+ //{
+ // if (services == null) throw new ArgumentNullException(nameof(services));
- int port = AppSettings.Get("WebSocketPort").ObjToInt();
- if (port == 0)
- {
- port = 9296;
- }
-
- services.AddSingleton(x =>
- {
- WebSocketServer socketServer = new WebSocketServer();
- socketServer.ServerStart(port);
- return socketServer;
- });
+ // int port = AppSettings.Get("WebSocketPort").ObjToInt();
+ // if (port == 0)
+ // {
+ // port = 9296;
+ // }
+ // services.AddSingleton(x =>
+ // {
+ // WebSocketServer socketServer = new WebSocketServer();
+ // socketServer.ServerStart(port);
+ // return socketServer;
+ // });
+ //}
+ public static void AddWebSocketSetup(this IServiceCollection services)
+ {
+ if (services == null) throw new ArgumentNullException(nameof(services));
+
+ int port = AppSettings.Get("WebSocketPort").ObjToInt();
+ if (port == 0)
+ {
+ port = 9296;
+ }
+
+ // 鐩存帴鍒涘缓骞跺惎鍔� WebSocket 鏈嶅姟鍣�
+ WebSocketServer socketServer = new WebSocketServer();
+ socketServer.ServerStart(port);
+ services.AddSingleton(socketServer);
+
}
}
}
--
Gitblit v1.9.3