I'm in the process of writing a piece of code that connects to a server spawns a bunch of threads using that connection and does a bunch of "stuff".
There are certain instances where the connection fails and I need to stop everything and start from scratch with a new object.
I wanted to clean up after the object but calling thread.stop on the threads, but this method is seemingly deprecated.
What is the recommended alternative to doing this? Should I write my own cleanup and exit method for each of the threads? Set the thread to null? or something else?