Skip to content

Commit cfbe88a

Browse files
committed
Added packet flush before request in forceUpdate(). Fixes issue #49 in the upstream repo
1 parent 020aaf8 commit cfbe88a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

NTPClient.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ bool NTPClient::forceUpdate() {
6565
Serial.println("Update from NTP Server");
6666
#endif
6767

68+
// flush any existing packets
69+
while(this->_udp->parsePacket() != 0)
70+
this->_udp->flush();
71+
6872
this->sendNTPPacket();
6973

7074
// Wait till data is there or timeout...

0 commit comments

Comments
 (0)