Hello,
I have following code running in a thread when application starts.
procedure TMainForm.SetSystemTime();
var
Sntp: TIdSNTP;
begin
Sntp := TIdSNTP.Create(nil);
try
Sntp.Host := 'pool.ntp.org';
try
Sntp.SyncTime();
except
// eat exception, we are in thread
end;
finally
Sntp.Free();
end;
end;
When there is no internet connection, thread above code runs is never terminated. I could not find some connection timeout setting for IdSNTP.
Is there any other way to terminate Sntp.SyncTime() if it is not completed for a certain period of time like 10 seconds.
There is a location with a corporate firewall (with some weird settings I believe) where check for an internet connection is true, but above code still hangs.
Thanks & Regards,
Ertan