This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Any ideas why this is happening? I thought the stop method would exit gracefully from the thread...
What is happening is ... the stop flag is only checked when the readline() method returns, which in this case, is caused by an exception thrown when the socket is closed.
What you need to do is, in your catch block, is check to see if the stop condition is true. If it is, then you need to ignore the exception, don't print out the exception, and cleanup and exit gracefully.