Listen Infinitely

well... you just set the winsock component to Listen. You shouldn't need to set anything else but you'd generally have code that triggers when data is received.
 
er... isn't that what you're using? If not, then yes, winsock is effecient if basic. Setting it to Listen tells it to set a hook and winsock will be notified by the os when data is received. It saves having to code a loop
 
there isn't any reason why you *can't* use winsock in a service. After all, the IIS SMTP service for email is listening on port 25 for example. Just remember to close the port cleanly when your service is paused, stopped or cancelled.
 
Why use the old COM when you have .Net Framework support in System.Net.Sockets ?
Multithreading is a piece of cake, writing a loop as simple as keying "Do" (Enter).
Samples about TcpClient/TcpListener is what you should be looking at.
 
Back
Top