Fix and refactor backoff mechanism.
Implemnt retry param for connect.
Retry connect indefinitely when cli.