Added packet flush before request in forceUpdate(). Fixes issue #49 in the upstream repo

This commit is contained in:
James Brown 2019-01-12 13:32:05 -07:00
parent 020aaf868d
commit cfbe88a3e2

View File

@ -65,6 +65,10 @@ bool NTPClient::forceUpdate() {
Serial.println("Update from NTP Server"); Serial.println("Update from NTP Server");
#endif #endif
// flush any existing packets
while(this->_udp->parsePacket() != 0)
this->_udp->flush();
this->sendNTPPacket(); this->sendNTPPacket();
// Wait till data is there or timeout... // Wait till data is there or timeout...