From cfbe88a3e2df5b916d4a7146fa0a83dacf88bd39 Mon Sep 17 00:00:00 2001 From: James Brown Date: Sat, 12 Jan 2019 13:32:05 -0700 Subject: [PATCH] Added packet flush before request in forceUpdate(). Fixes issue #49 in the upstream repo --- NTPClient.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NTPClient.cpp b/NTPClient.cpp index 87b7a53..668d72b 100644 --- a/NTPClient.cpp +++ b/NTPClient.cpp @@ -65,6 +65,10 @@ bool NTPClient::forceUpdate() { Serial.println("Update from NTP Server"); #endif + // flush any existing packets + while(this->_udp->parsePacket() != 0) + this->_udp->flush(); + this->sendNTPPacket(); // Wait till data is there or timeout...