| | |
| | | private static System.Timers.Timer _pushTimerBeat; |
| | | // 300000 |
| | | private static readonly int _pushInterval = 300000; // 每5分钟发送一次消息 |
| | | |
| | | private static Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | |
| | | /// <summary> |
| | | /// 启动 WebSocket 服务(监听 8089 端口) |
| | | /// </summary> |
| | | public static void Start() |
| | | { |
| | | // 配置 WebSocket 监听地址(独立端口 8089) |
| | | var wsUrl = "ws://0.0.0.0:8089/ws"; // 0.0.0.0 允许外部访问 |
| | | string sReturn = ""; |
| | | var wsUrl = "ws://0.0.0.0:12345/ws"; // 通用端口 |
| | | |
| | | // 配置 WebSocket 监听地址(独立端口 12345) |
| | | _server = new Fleck.WebSocketServer(wsUrl); |
| | | |
| | | _pushTimer = new System.Timers.Timer(_pushInterval); |