Will ESP Crash after certain reconnection?

Hello !!
I have seen many of our Blynkers using these lines for reconnection

 if (Blynk.connected()) {
    Blynk.run();
  } else if (ReCnctFlag == 0) {
    ReCnctFlag = 1;
    Serial.println("Starting reconnection timer in 10 seconds...");
    Timer.setTimeout(10000L, []() {
      ReCnctFlag = 0;
      ReCnctCount++;
      Serial.print("Attempting reconnection #");
      Serial.println(ReCnctCount);
      Blynk.connect();
    });
  }

My doubt is, what if the connection is dropped for days together ? Will the ESP crash after certain number of retries ? Because ReCnctCount this value will go on raising every 10 seconds !!
Have anyone faced issue on this ? And is it better to remove the serial print ? Serial.println("Starting reconnection timer in 10 seconds..."); Serial.print("Attempting reconnection #"); just to lessen the burden for ESP ?

Assuming that ReCnctCount is an unsigned long variable type, the largest number that can be stored is 4,294,967,295
If the counter is incremented every 10 seconds then it’ll take 1,300 years before the counter rolls-over. But, when it does it won’t crash the MCU, it will simply go back to zero.

Pete.

Before that the internet will be probably back i guess :stuck_out_tongue_winking_eye:
i have int and even this can store 2,147,483,647 i never imagined this huge numbers.

Not sure !! :rofl:

1 Like