Tinkerforge/generators — pull request #38 by bparzella (2013-04-13 20:42:19+00:00)
Title: Python: avoid orphan threads on connection failure

On connecting to a brick a callback processor (callback_loop) is called. When the connection failed, an exception is raised, without stopping the callback thread. This increases the thread count for each connection retry.
Calling "disconnect" won't shut the thread down, because the socket is not connected.

Sending an QUEUE_EXIT to the callback queue when the connection fails, will make the callback_loop exit.

I am not sure if this affects the "is_auto_reconnect" handling.