Add a timeout value to the long polling requests.
Merge pull request #335 from ametaireau/reconnect-on-timeout

Add a timeout value to the long polling requests.