Simple example for CURLNMultiMBS

  1. 6 months ago

    I am new to xojo and the Curl plugin. I am not getting CURLNMultiMBS to process 4 urls by following the included example. Also the included example seems to process only 2 of 4 urls for me when I remove all other urls in the example. After 2 of the 4 urls, it shows that it is done.

    Does anybody has a very basic example about how to process async 4 urls with CURLNMultiMBS for me as a start?

  2. Christian S

    17 May 2019 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    Do you see a bug in our example?

  3. No, it just shows that its done after 2 urls, and does not process all urls fro the list.
    For example, I removed all except 4 urls from the array in the example and run it. It processed 2 urls and then stopped and showed that its finished.

    I then tried to use just the CURLNMultiMBS, created a class like in the example, and added 2 CURLNMBS via multi.AddCurl(...) and it did not trigger the finish event. I do not really understand fully the example, thats why I asked for a simple basic code which use the CULRNMultiMBS and can process 4 urls async.

  4. Christian S

    17 May 2019 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    For me it works both with S and N in the class name. Loads all 20 URLs.

  5. @ChristianSchmitz For me it works both with S and N in the class name. Loads all 20 URLs.

    Ok, then I must be doing something wrong. Maybe because I really dont understand xojo yet (coming from Delphi where things are just very different)

    Anyway, I was hoping there is a very basic example somewhere.

  6. Christian S

    17 May 2019 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    This example is asynchronous which is not easy, but if you want CURL*Multi, you ask for this.

    In the finish event for each transfer, you may want to inspect DebugData of the curl object. Maybe it shows an error message about the connection?

  7. I found 1 issue, related to a url. When I use the url http://www,cars.com/ with your example, its stuck and never trigger the finish event. The url redirects to the https site https://www,cars.com/, at least in browser. How can I figure out what the site returns, what header etc., when the finish event is not triggered?

  8. Christian S

    18 May 2019 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    You can email me the test project with URLs included.
    Then I can test it

  9. Andrew L

    18 May 2019 San Francisco, CA, USA
    Edited 6 months ago

    @Guenter K http://www,cars.com/

    Typo in the URL? Should be http://www.cars.com/

  10. @ChristianSchmitz You can email me the test project with URLs included.
    Then I can test it

    I just emailed you the test project.

  11. Dave S

    18 May 2019 San Diego, California USA

    isn't this the same issue with other HTTP routines?

    They no long work with HTTP:// but require HTTPS:// now?

  12. Beatrix W

    18 May 2019 Pre-Release Testers, Third Party Store Europe (Germany)

    @Dave Sisemore: the website should forward from http to https. It's a line in the htaccess file as far as I remember from my fun with https last year.

  13. Dave S

    18 May 2019 San Diego, California USA

    @Beatrix W @Dave Sisemore: the website should forward from http to https. It's a line in the htaccess file as far as I remember from my fun with https last year.

    I don't do much with Internet traffic, but seem to recall a recent posting where the was NOT a true statement, and it had to start as HTTPS or it didn't work.. not to mention not all websites are HTTPS compatible.

    for example:
    HTTP://www.rdsisemore.com - works
    HTTPS://www.rdsisemore.com does not

  14. Christian S

    19 May 2019 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    I tried it. It works quite well. 10 pages load quickly. But 11th page http://www.cars.com/ sometimes takes a bit and gives a timeout eventually.

    I would suggest something like this:

    c.OptionConnectionTimeout = 10
    c.OptionTimeOut = 30

    To avoid waiting 2 minutes for the transfers.

    And if we set an User-Agent, it seems to load even for cars website:

    c.SetOptionHTTPHeader Array("User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Safari/605.1.15")

    Please try that.

or Sign Up to reply!