drothlis/stb-tester — pull request #11 by asimihsan (2013-04-30 14:13:33+00:00)
Title: irnetbox: Timeout the TCP connection attempt after 10 seconds.

I'd like to use IRNetBox to determine whether the irnetbox has frozen or not. Usually attempting to set up a TCP socket to a dead irnetbox will raise a "Connection refused" socket exception. However, I've also seen times when the TCP socket connection attempt completely hangs.

This commit adds a 10 second timeout _to the socket connection attempt only_. I do not want to keep the timeout applied because this would change how the script behave later on; it seems to rely on blocking reads from the socket.