2010-07-29, 22:05
Amet Wrote:the opensubtitles service does have a timeout, it is set to 5 sec
svn can be found here, PM me the diff if you want me to add it.
Thanks!
If for any reason the connection is not working, the script halts for a long time (I haven't really waited enough to see if it eventually returns but I waited for more than 3 minutes before I killed XBMC), so the timeout of opensubtitles.org does nothing to rectify the problem. The connection timeout/handling must be done client side as I did it and works fine.
Here's the diff:
http://pastebin.com/NHRmAJRm
It includes a timeout and a general connection error handling, as well as a new setting for the timeout plus 2 new languages strings.
I use the socket.setdefaulttimeout method for the timeout and it works well. I set it before the connection and reset it immediately after so it will cause no problem for other connections.
But it must be noted that you need to remove the try-catch block on each service, or at least do a raise on the except clause so it can the exception can be passed to the outer try-catch block of gui.py. I only did this for the opensubtitles service, but must be done on all of them to be consistent.
Feel free to incorporate them.
Cheers,
John.