Corrected message runner thread leakage. #28
Corrected message runner thread leakage. #28

The problem arises when you try to disconnect and reconnect within a messsage handler. The new connection starts a new runner thread, and the old thread sees the new valid state so it doesn't exit. Now we're blocking until the old thread is dead before we start a new one. I'd rather save the old thread, but it's going to be complicated and bug-prone to try to determine that it's not already shutting down. For now, if you want to disconnect/reconnect in a message handler, you'll need to use ClientBase.ConnectAsync instead of the blocking extension method or you'll deadlock.

chkn/Tempest