Replace sleep with connect loop for ncsvc connection.