I created a program that automatically connects to our local server and downloads updates, here is the code:
// Connect to web server and download ToBeInstalled.ini
Url := 'http://'+IPAdd+'/ToBeInstalled.ini';
MS := TMemoryStream.Create
try
try
http.Get(url, MS);
code := http.ResponseText;
except
on E: EIdHTTPProtocolException do
code := http.ResponseCode;
end;
MS.SaveToFile(UserPath + 'ToBeInstalled.ini');
finally
http.Free();
end;
The program works quite well while in the office but when users are home and cannot reach the server or the server is not available the get "socket error # 10061'
I have no idea how to catch that one and the worse is that the program stop execution all together after that error message is displayed. Do you have any idea how to fix that. Thank you so much.