add connection failure/retry logic

Signed-off-by: Stephen Gran <stephen.gran@piksel.com>