Click here to Skip to main content
16,008,010 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
I'm new to WPF

How to maintain background worker thread keep Alive during internet disconnect?

Regards,
Prabu
Posted
Updated 15-Nov-11 18:53pm
v2

1 solution

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 http://msdn.microsoft.com/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
 
Share this answer
 
Comments
Mehdi Gholam 16-Nov-11 1:03am    
Exactly what I was going to say, 5'ed
Sergey Alexandrovich Kryukov 16-Nov-11 1:06am    
Thank you, Mehdi.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900