z8018
2 天以前 d8dc91f9c1fece5711e38edd1b1274cb9e579015
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//using HslCommunication.WebSocket;
//using WIDESEA_Core.Helper;
 
//namespace WIDESEA_ProductMgmtServer.HostedService
//{
//    public static class WebSocketSetup
//    {
//        public static void AddWebSocketSetup(this IServiceCollection services)
//        {
//            if (services == null) throw new ArgumentNullException(nameof(services));
 
//            if(AppSettings.Get("WebSocketEnable").ObjToBool())
//            {
//                int port = AppSettings.Get("WebSocketPort").ObjToInt();
//                if (port == 0)
//                {
//                    port = 9296;
//                }
 
//                services.AddSingleton(x =>
//                {
//                    WebSocketServer socketServer = new WebSocketServer();
//                    socketServer.ServerStart(port);
//                    return socketServer;
//                });
//            }
//        }
//    }
//}