本文介绍了背景工人问题.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
—SA
Thread life cycle has nothing to do with internet connection, it is kept alive until the thread exits its main method or is aborted. It also has nothing to do with WPF unless UI is involved (than see the class System.Windows.Threading.Dispatcher).
However, for network communications better design uses some "permanent" thread, created by its constructor System.Threading.Thread.Thread, see msdn.microsoft/en-us/library/system.threading.thread.aspx[^].
You can find some ideas in my past solutions:
using api in c# and socketprogramming[^],
Multple clients from same port Number[^],
automatic updater triggered via server[^].
If this is not related to your application — sorry, you did not provide any detail.
—SA
我是WPF的新手 Internet断开连接期间如何保持后台工作线程保持活动状态? 问候, Prabu
Hi, I''m new to WPF How to maintain background worker thread keep Alive during internet disconnect? Regards, Prabu
推荐答案线程生命周期与Internet连接无关,它一直处于活动状态,直到线程退出其主要方法或中止为止.除非涉及UI,否则它也与WPF无关(请参阅类System.Windows.Threading.Dispatcher). 但是,对于网络通信来说,更好的设计使用一些由其构造函数System.Threading.Thread.Thread创建的永久"线程,请参见 msdn.microsoft/en-us/library/system.threading.thread.aspx [ ^ ]. 您可以在我过去的解决方案中找到一些想法: 在C#和套接字编程中使用api [ ^ ], 来自同一端口号的多个客户端 [ ^ ], 通过服务器触发的自动更新程序 [ ^ ]. 如果这与您的应用程序无关—很抱歉,您没有提供任何详细信息.
更多推荐
背景工人问题.
发布评论