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