HttpRequest timeout

About Monkey 2 Forums Monkey 2 Programming Help HttpRequest timeout

This topic contains 7 replies, has 2 voices, and was last updated by  Xaron 3 weeks, 3 days ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #14668

    Xaron
    Participant

    Hi there,

    is there a way to set a timeout for httprequests or what is the default value?

    Thanks!

    #14671

    Mark Sibly
    Keymaster

    The default timeout is apparently 60 seconds for ios and ‘infinite’ for android. I’ll add the ability to be able to set timeout soon.

    What would be a good common default?

    #14672

    Xaron
    Participant

    Hey Mark, thanks!

    I think 10 seconds would be a good default because when the webserver doesn’t reply within 10 seconds there’s probably a problem anyway. But if you have this as a parameter it shouldn’t be a problem anyway.

    Does it work with the Emscripten target btw?

    #14682

    Xaron
    Participant

    Oh I just see that httprequest only works for Android and iOS but not for Desktop and Emscripten. Is there any ETA when this is going to happen or are there no plans to add it?

    #14685

    Mark Sibly
    Keymaster

    For desktop I would recommend using wget or curl right now as they deal with all the proxy/https etc BS that a raw socket implementation can’t (and I wont be attempting to build libcurl (again) any time soon).

    See src/ted2go/product/ModuleManager.monkey2 for an example, esp. DownloadModules() function.

    There is no ETA for an emsctipten WGET yet, although there is a ‘fetch’ API that could theoretically do the trick if anyone’s interested in mx2-ifying it.

    #14689

    Xaron
    Participant

    Ah I see thanks.

    #14690

    Mark Sibly
    Keymaster

    I managed to get the fetch API going and am in the process of doing an HttpRequest for all targets…

    #14692

    Xaron
    Participant

    Wow, I did not expect that. You’re always good for a surprise. 🙂 Thanks! Desktop would be enough if Emscripten is too much work.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.