How can i end the {cayenne.loop()} if there is no connection?

thank you for your help i will be waiting for your solution please inform me as soon as you get any thing on this topic.