Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Design question  RSS feed

 
Michael Arnett
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ouaknin lionel
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!