TFPHTTPClient.ConnectTimeOut is not available? lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- senglit · 2020-06-18 18:02 Hi all, When I do TFPHTTPClient.HTTPMethod() to connect a server which is actually not available, it will wait for a longtime to return. I searched the forum and found that TFPHTTPClient has a property named ConnectTimeOut. But when I wrote some code like: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var  HTTPClient: TFPHTTPClient;begin  HTTPClient := TFPHTTPClient.Create(nil);  ...  HTTPClient.ConnectTimeOut:=1000;end;  It can not be compiled and I got a hint :Error: identifier idents no member "ConnectTimeOut" I Checked the file fphttpclient.pp and did not see anything like "ConnectTimeOut" I wonder if TFPHTTPClient really has a parameter named ConnectTimeOut? How can I wait shorter if the server is not available? ps: I also set IOTimeout property to 1000, but it seems not work. It waited around 10 seconds to return when the server is not available. ---------------------------------------------------------------------- senglit · 2020-06-18 18:20 the idea of ConnectTimeout came from: https://forum.lazarus.freepascal.org/index.php/topic,47754.msg342558.h tml#msg342558 and https://forum.lazarus.freepascal.org/index.php/topic,48418.msg348633.h tml#msg348633 ---------------------------------------------------------------------- TRon · 2020-06-18 18:50 1 https://github.com/graemeg/freepascal/commit/ceb3801bc03973e69266593 47e694c17d5b843c8#diff-f1c5ea86202b7090810a8d4352122bca 2 https://github.com/graemeg/freepascal/commit/e02c6e2fb812c2994e4d8eb f2b66309111b23414#diff-f1c5ea86202b7090810a8d4352122bca From which date is your Free Pascal version ? ---------------------------------------------------------------------- senglit · 2020-06-18 19:52 Quote from: TRon on June 18, 2020, 08:50:23 pm1 https://github.com/gra emeg/freepascal/commit/ceb3801bc03973e6926659347e694c17d5b843c8#diff- f1c5ea86202b7090810a8d4352122bca 2 https://github.com/graemeg/freepascal/commit/e02c6e2fb812c2994e4d8eb f2b66309111b23414#diff-f1c5ea86202b7090810a8d4352122bca From which date is your Free Pascal version ? I am using FPC3.0.4 installed together with Lazarus 2.0.6. After reading your reply, I downloaded fpc-3.0.4.source.zip from sourceforge, there is still no ConnectTimeout in fphttpclient.pp.  But FPC3.0.4 should be the newest version according to https://www.freepascal.org/download.html Then, I downloaded the newest fphttpclient.pp (modified 2 monthes ago) from github and replaced the old file. There is ConnectTimeout inside and Lazarus IDE can recognize it and put it in the to-choose box when I typed "HTTPClient." But I still got a Error: identifier idents no member "ConnectTimeOut" when I tried to compile it. I guess it because fphttpclient.ppu is still the oldversion. but I don't know how to compile it. What should I do? ---------------------------------------------------------------------- TRon · 2020-06-18 20:00 My bad senglit, so apologies. I thought the 3.2 release candidate was a well-known fact: https://forum.lazarus.freepascal.org/index.php/topic,49110.0.html ---------------------------------------------------------------------- senglit · 2020-06-18 20:17 Quote from: TRon on June 18, 2020, 10:00:51 pmMy bad senglit, so apologies. I thought the 3.2 release candidate was a well-known fact: https://forum.lazarus.freepascal.org/index.php/topic,49110.0.html Thanks. I've download it and now I'm studing how to compile it and replace my FPC3.0.4 ---------------------------------------------------------------------- TRon · 2020-06-18 20:20 To bump the thread so TS is aware: @senglit: Also take note of this thread: https://forum.lazarus.freepascal.org/index.php/topic,49356.0.html I am not sure how/what to advise, in your circumstances. I use Freepascal and Lazarus from trunk and, I have no idea if Lazarus 2.0.8 will work without any issues in combination with Freepascal 3.2rc1 ---------------------------------------------------------------------- heejit · 2020-06-19 13:21 try IOTimeout