Skip to content

Commit

Permalink
- stop UDP to prevent socket to remain open (suggested by @facchinm)
Browse files Browse the repository at this point in the history
  • Loading branch information
ubidefeo committed Mar 21, 2019
1 parent 2c5ecf4 commit 42d1123
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/utility/NTPUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ unsigned long NTPUtils::getTime() {
while (!Udp.parsePacket() && (millis() - start < 10000)){}
if (millis() - start >= 1000) {
//timeout reached
Udp.stop();
return 0;
}
Udp.read(packetBuffer, NTP_PACKET_SIZE);
Expand Down

0 comments on commit 42d1123

Please sign in to comment.