How do I write a windows service in c# that listens for tcp connections and processes these connections? The problem is that I want a better method than to "block" in the main thread e.g.
while(true) ;
I can start the listener on another thread but the main thread needs to block to prevent the application from exiting (and the service from stopping). Thanks.