All, I was looking for some ideas on what seems to be a common application. I want to develop a simple java server application that simply listens for connections and when a client connects, the application will spawn a thread that manages the socket and processes the incoming data, etc. and then the thread will clean up the socket, etc and close down elegantly. The primary design question is how would one elegantly shut down the server which in turn elegantly shuts down all of its spawned processes ( regardless of what state they are in ) and returns some appropriate error msg to clients. Thanks in advance, -MLA
Sun Certified Programmer for the Java 2 Platform 1.4
posted 13 years ago
you have got to keep book of all the thread you create. In an array or a vector. then Thread.interrupt() seems a good idea. or use a specific method to shut down the thread...
"Nobody will ever need more than 256 kb of ram" -Bill Gates