Key Pressed Event / Ending thread
In my server program I have a thread set up to listen for requests, and assigns each incoming request to another thread. I'd like to set up an event handler that fires when a key is pressed to execute a number of different options depending on which key is pressed. I have two questions:
1) What event handler should I use? I don't have a C# book - I'm basically learning from some tutorials and MSDN's reference section, so my knowledge in this area is impaired somewhat. If I could just get the name of what would be the ideal handler, I can look it up on MSDN and figure it out from there.
2) I've started the threads and sockets, but I don't know how to end them. Do I just use the delete keyword on those objects, or what? I'd like to do this from the event handler, to pass control from the threads, back to a traditional console application style.