Not a good idea to spam NIST with NTP requests

This commit is contained in:
Alex 2023-03-22 23:49:21 +02:00
parent 518ef7b0fd
commit 71cc336ac5
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

View File

@ -123,14 +123,14 @@ namespace NetworkInterfaceManager
*/
InternetProtocol ip = {.v4 = {.Address = {129, 6, 15, 28}},
.v6 = {.Address = {}}};
NetworkUDP::Socket *NTP_Socket = udp->Connect(ip, 123);
NetworkNTP::NTP *ntp = new NetworkNTP::NTP(NTP_Socket);
udp->Bind(NTP_Socket, ntp);
int UnixTimestamp = ntp->ReadTime();
Time::Clock time = Time::ConvertFromUnix(UnixTimestamp);
DbgWriteScreen("NTP: %d - %d.%d.%d %d:%d:%d", time.Counter,
time.Day, time.Month, time.Year,
time.Hour, time.Minute, time.Second);
// NetworkUDP::Socket *NTP_Socket = udp->Connect(ip, 123);
// NetworkNTP::NTP *ntp = new NetworkNTP::NTP(NTP_Socket);
// udp->Bind(NTP_Socket, ntp);
// int UnixTimestamp = ntp->ReadTime();
// Time::Clock time = Time::ConvertFromUnix(UnixTimestamp);
// DbgWriteScreen("NTP: %d - %d.%d.%d %d:%d:%d", time.Counter,
// time.Day, time.Month, time.Year,
// time.Hour, time.Minute, time.Second);
TaskManager->Sleep(200);
/* TODO: Store everything in an vector and initialize all network cards */