Rewrite reconnecting logic to eliminate unexpected blocking
Reconnect internally if initial connecting failed