Hello,
I have a simple HttpJob posting queries via Http and receiving some Json data.
This is a little example
B4X:
Sub GetData(MyURL As String, MyPOST As String)
Dim job As HttpJob
job.Initialize("Job", Me)
job.PostString(MyURL, MyPOST)
End Sub
Sub JobDone(Job As HttpJob)
'Some Operations
End Sub
My question is:
If a query (n+1) come after a query (n), and query (n) is still executing will be aborted or will be 2 "JobDone" Calls?
I would like only to have the last query returned. So, if query (n) is already running and query (n+1) is asked via http, (n) should be aborted (I'm not interested anymore) and i'll need to wait only for (n+1)...... and so for (n+2).....
Thank you
I´m not sure i understand the question.
BUT: Each call to GetData will result in starting a new download which then will raise a call to JobDone.
In short: Calling GetData twice will result in two Jobdone raises...
But they are not supposed to be in order. Maybe the second is faster then the first then the second will raise the first Jobdone
A simple solution i've found is to send a request id to the server, so the server replies with this id.
So i can get the right and latest response id, but i do not like to take thia approach ... could open too much connections to the server
Since to know who was the latest client to make a request to the server i'll need to store some data inside the server session (ip for example), this is a bad solution for me.
I dont' want to save any client data to the server.
First, I would like to respect privacy, even for ip addresses.