Automatic switch from non-blocking to blocking thread so that the reconnect process doesn't hang the system.