[tor-dev] TOR control protocol timeout

Sean Robinson seankrobinson at gmail.com
Sat Jun 25 21:59:48 UTC 2011

On Sun, Jun 19, 2011 at 11:18 AM, Damian Johnson <atagar1 at gmail.com> wrote:
>> you and atagar...
> I am atagar.

LOL!  It's a small world, eh?

> All the concurrency issues for shutting down should have been
> addressed. What sort of problems are you encountering? Do you have a
> use case for reproducing the issue?

I had not done more testing since the socket.shutdown() was added.
Now I have tested and I no longer have TOR connections hanging.  Thank

>> I would like to have readline() detect when a socket error has
>> occurred.
> A socket error should result in a None return value that shuts down _thread.

As long as the socket error is local, then None is returned.  I was
concerned about remote (silent) errors going undetected.  But, further
tests (e.g. 10 minute timeout) also did not work on a long-running
client listening for TOR events.  I now believe that absent a defined
keep-alive framework in the control protocol, it is best for any
client which cares to check the connection status to periodically run
a small query (i.e. "GETINFO version") and check for a response.

Sean Robinson
WiFi Radar - http://wifi-radar.berlios.de
Python WiFi - http://pythonwifi.wikispot.org
pymnl - http://pymnl.wikispot.org

More information about the tor-dev mailing list