Add timer for connection retries and improve exception handling.
Merge pull request #5 from Hamuko/retry-timer

Add timer for connection retries and improve exception handling.