Simple example for CURLNMultiMBS

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?

Do you see a bug in our example?

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.

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.

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?

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

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

Typo in the URL? Should be

[quote=437078:@Christian Schmitz]You can email me the test project with URLs included.
Then I can test it[/quote]

I just emailed you the test project.

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

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

@Dave S: 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:// - works
HTTPS:// does not

I tried it. It works quite well. 10 pages load quickly. But 11th page 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.