Loop tasks while connected