T
Timothy Wu
I'm writing a small utility that listens for socket connections, and
also repond to user inputs via a text menu selection.
In order to respond to both the user and the incoming connections I
figure I need to use thread.
I think I would use the main thread to handle the menu and spawn a
thread which listens on a socket.
Now my question is, how do I terminate the server thread if user wants
to exit the application? If the server just sit there and listen the
thread would never terminate by itself. What kind of inter-thread
communications are available and where would I find info/tutorial on that?
Timothy
also repond to user inputs via a text menu selection.
In order to respond to both the user and the incoming connections I
figure I need to use thread.
I think I would use the main thread to handle the menu and spawn a
thread which listens on a socket.
Now my question is, how do I terminate the server thread if user wants
to exit the application? If the server just sit there and listen the
thread would never terminate by itself. What kind of inter-thread
communications are available and where would I find info/tutorial on that?
Timothy