KMatle Expert Licensed User Longtime User Feb 8, 2015 #1 I'm trying to decrease the timeout of a httpjob to check if the server is working (a "ping" is not enough). I send a simple job calling a php. I wish to decrease the timeout to 2-3 secs (30 is to long to check if the server is working). For some reasons I can't use Job.GetRequest.Timeout (method "Timeout" is not known) with Job.Download2 (I'm on b4a 4.0 and httputils2 2.01). Any ideas?
I'm trying to decrease the timeout of a httpjob to check if the server is working (a "ping" is not enough). I send a simple job calling a php. I wish to decrease the timeout to 2-3 secs (30 is to long to check if the server is working). For some reasons I can't use Job.GetRequest.Timeout (method "Timeout" is not known) with Job.Download2 (I'm on b4a 4.0 and httputils2 2.01). Any ideas?
Peter Simpson Expert Licensed User Longtime User Feb 8, 2015 #2 Here you go: Code: Dim GetWhatever As HttpJob GetWhatever.Initialize("GetWhatever", Me) GetWhatever.Download... 'or whatever GetWhatever.GetRequest.Timeout = DateTime.TicksPerSecond * 10 '10 = 10 seconds etc... Enjoy... Upvote 0
Here you go: Code: Dim GetWhatever As HttpJob GetWhatever.Initialize("GetWhatever", Me) GetWhatever.Download... 'or whatever GetWhatever.GetRequest.Timeout = DateTime.TicksPerSecond * 10 '10 = 10 seconds etc... Enjoy...
KMatle Expert Licensed User Longtime User Feb 8, 2015 #3 Pffffff.... No one told me to inlude the http lib! With httputils2 only there is GetWhatever.GetRequest but no GetWhatever.GetRequest.Timeout So the same methods (but different) are in TWO different libs and then merged to one (class)? @Peter Simpson ? Even if httputil2 uses http this confuses as you see. Upvote 0
Pffffff.... No one told me to inlude the http lib! With httputils2 only there is GetWhatever.GetRequest but no GetWhatever.GetRequest.Timeout So the same methods (but different) are in TWO different libs and then merged to one (class)? @Peter Simpson ? Even if httputil2 uses http this confuses as you see.
Erel B4X founder Staff member Licensed User Longtime User Feb 9, 2015 #4 KMatle said: So the same methods (but different) are in TWO different libs and then merged to one (class)? Click to expand... No. HttpJob is declared in HttpUtils2 library. HttpRequest is declared in Http library. HttpJob.GetRequest returns HttpRequest object. The IDE will not recognize this object unless you add a reference to Http library. Upvote 0
KMatle said: So the same methods (but different) are in TWO different libs and then merged to one (class)? Click to expand... No. HttpJob is declared in HttpUtils2 library. HttpRequest is declared in Http library. HttpJob.GetRequest returns HttpRequest object. The IDE will not recognize this object unless you add a reference to Http library.