Essentially, the calls using URLConnection dont always ‘work’ as expected. Ones that dont, so far, do work as epected with HTTPSecureSocket but I know its dep and http 1.0 vs 1.1 but Im not sure if I should just go use a strategy that uses httpsecsock. My question is: what would you guys do?
I haven’t tried either recently, but both were so inconsistent across Xojo releases and platforms that I made my own system using CURLMBS, which, even if a bit esoteric and arcane, is rock solid.
If you are using Christian’s plugin then you can call PerformMT which runs cURL in a preemptive thread. I think PeformMT has to be used from within a Xojo thread though.
Yeah I wish it were that simple. It’s been at least a year since I touched it, but it was definitely problematic enough that I had to switch back. I think it was something to do with making multiple requests at the same time.
I have to ask you to clarify Thom, MBS cURL was thread blocking? I have multiple synchronous calls to make based on each call’s returned values from some endpoints so I have been instantiating subsequent calls on subclasses of URLConnect that each have a select logic which to call next. I dont like this all that much but it works. Im assuming I wouldnt run into that more with mbs tahn i am now right? I just want a backbone that I ‘know’ wont get squirrely.
We’ve been using PerformMT on macOS & MS-Windows for over 5 years and have not had any noticeable blocking issues. In some cases the application has been performing 10 FTP transfers and a HTTPS request at the same time.
It is worth noting that the requests would have been mainly to servers that our customers own or have hosted in data centres.
Thom is so far above my level that I would not presume to be able to improve on his code, but as Christian wrote the plugin maybe he can check the code and improve it? Seems like something that would be both a high priority and a great example for MBS … if it works …
From memory, we created a class that mimicked the HTTPSocket class that used a Xojo thread to setup cURL and call PerformMT. Xojo events were then raised on the main thread.