I’ve made a Subclass of URLConnection and added Methods for various (PUT,GET,POST) Tasks.
In the ContentReceived Event of my Subclass i am checking the HTTPStatus and the content and as a result, may call then another Method within my Subclass which in turn do a Send again.
But i get always a “A request is already in progress” exception. I thought the ContentReceived Event will fire when the content has been received and i can do a new Send?
I would be that there’s a flag that gets unset after the event. However, for reliability it has been recommended multiple times to not re-use a socket. If necessary I build a queuing system with a module.
I added a Xojo.Core.Timer Private Property called SocketTimer to the Subclassed Socket.
Then added a sender As Xojo.Core.Timer as Parameter to my Methods.
Currently only Basic (Name/Password) auth. But will be certificate secured when the servers go live.
I Subclassed a URLConnection which needs to Auth with the Server. And i think each new Socket needs to authenticate before it can communicate with the Server?
In my case, i need to transfer thousands of customers, contacts and Phonenumbers from mySQL Databases to sip:wise Servers using HTTPS and JSON. There can be more than 8.000 Phonenumbers in one App Session needed to be transferred. This would take a few hours (more) if i would have to re-authenticate each “Check if Customer exist, check if Contact exist, Create Contact, Create Customer, Create Subscribers” cycle.
Maybe, but my current solution works just fine and it’s just a workaround for a Bug in URLConnection which has been fixed for a future release. :)[/quote]
I saw that you had this all sorted out. I was just wondering if this would work since I have yet to actually use one!
I am sorry to say this but i cannot recommend to use URLConnection in it’s current state. There are more issues other reported in the Feedbacks. But my project is nearly finished and i need to move on.
If i should recommend a solution i would recommend to use the CURL Addon by MBS. It’s far more capable and issues will be fixed by @Christian Schmitz in very short time.