Arduino OTA: Quit Service

Hello, everybody,
I want to stop the OTA service on my microcontroller.
However, it doesn't seem to admit a call like "ArduinoOTA.end();".
My next idea would be not to call the "ArduinoOTA.handle();" in the loop anymore - but is this the way to go?

Do you have a good idea?

Timmmy001:
Hello, everybody,
I want to stop the OTA service on my microcontroller.
However, it doesn't seem to admit a call like "ArduinoOTA.end();".
My next idea would be not to call the "ArduinoOTA.handle();" in the loop anymore - but is this the way to go?

Do you have a good idea?

don't start it, if you don't want it to run

Juraj:
don’t start it, if you don’t want it to run

:o
Well, this is not every time a option…
I want it for a time and end it until I need it again.

is it about esp8266 or esp32 ArduinoOTA library or about my general ArduinoOTA library? If esp8266 or esp32, would you use my library if I add the end() function?

Sure, this sound good!

done. try the version from GitHub

Thank you for quick implementation!

But I'm afraid I haven't looked far enough:
The termination of the OTA function should be made after the failure of the OTA authentication, in order to reactivate it after a certain time.
In addition, I would still need to save the password as hash value.

I know - stupid, but everything for security...