Android Question [Solved]DEcrease timeout (httputils2) job.download2

Discussion in 'Android Questions' started by KMatle, Feb 8, 2015.

  1. KMatle

    KMatle Expert Licensed User

    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?
  2. Peter Simpson

    Peter Simpson Expert Licensed User

    Here you go:
    Dim GetWhatever As HttpJob
    "GetWhatever", Me)
    'or whatever
        GetWhatever.GetRequest.Timeout = DateTime.TicksPerSecond * 10 '10 = 10 seconds etc...
    Erel and DonManfred like this.
  3. KMatle

    KMatle Expert Licensed User

    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.
  4. Erel

    Erel Administrator Staff Member Licensed User


    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.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice