1
czw
1 天以前 9effc613a708237383938955c1ab89ab082d6ad4
1
2个文件已修改
29 ■■■■ 已修改文件
HnSx/Build/Project/代码/VS自定义类/AutoThread.cs 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HnSx/Build/Project/代码/界面事件.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HnSx/Build/Project/代码/VS自定义类/AutoThread.cs
@@ -120,8 +120,29 @@
        /// <param name="action"></param>
        public void ThreadSettingInit(Tag tag)
        {
            List<Task> tasks = new List<Task>();
            //tasks.Add(GetTask(sa2008, tag, 3000));
            Task.WaitAll(tasks.ToArray());
        }
        private Task GetTask(Action<Tag> action, Tag tag, int i = 2500)
        {
            var task = Task.Run(() =>
            {
                while (true)
                {
                    try
                    {
                        action(tag);
                    }
                    catch (Exception ex)
                    {
                        LogHelper.Error(ex.Message, ex);
                    }
                    Thread.Sleep(i);
                }
            });
            return task;
        }
        public async void ThreadwebSoc()
@@ -216,7 +237,7 @@
    public class HttpServer
    {
        public static readonly HttpHelper apiHelper = new HttpHelper();
        System.Net.HttpListener HttpSvcHost = null;
        public static System.Net.HttpListener HttpSvcHost = null;
        public static string _listenerPrefix = "";
        public HttpServer(string ip)
HnSx/Build/Project/代码/界面事件.cs
@@ -148,9 +148,9 @@
            try
            {
                Conn.log榛樿鏃ュ織.Debug("[鍏抽棴澶勭悊][Start]鍏抽棴Http鏈嶅姟");
                if (HttpSvcHost != null)
                if (HttpServer.HttpSvcHost != null)
                {
                    HttpSvcHost.Stop();
                    HttpServer.HttpSvcHost.Stop();
                }
            }
            catch (Exception ex)