I'm currently writing my own socket server (as the console app), and as I am new to multithreading in C# I started wondering about threading and backgrounds tasks. I found some possible alternatives to Threads like (BackgroundWorker
, but for UI) or Task
...
I have currenctly written a process, which periodically runs in endless while loop, where its checking clients if they are still connected.
As I cannot get opinion from searching on google, so I'm asking, is running processes in background, like my client check, through the Thread
and endless loop a proper way, or there are some better ways how to do it?