M Massimiliano Member Licensed User Longtime User Sep 2, 2015 #1 Hello, I have a simple HttpJob posting queries via Http and receiving some Json data. This is a little example Code: Copy 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 Massimiliano
Hello, I have a simple HttpJob posting queries via Http and receiving some Json data. This is a little example Code: Copy 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 Massimiliano
DonManfred Expert Licensed User Longtime User Sep 2, 2015 #2 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 Upvote 0
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
M Massimiliano Member Licensed User Longtime User Sep 2, 2015 #3 @DonManfred ...But they are not supposed to be in order!!! as you say I must to be sure to have only the latest query, so i need to abort previsious running queries Any hint? Many thanks Upvote 0
@DonManfred ...But they are not supposed to be in order!!! as you say I must to be sure to have only the latest query, so i need to abort previsious running queries Any hint? Many thanks
DonManfred Expert Licensed User Longtime User Sep 2, 2015 #4 Massimiliano said: Any hint? Click to expand... Yes. Just start the second after the first one has finished. Upvote 0
Massimiliano said: Any hint? Click to expand... Yes. Just start the second after the first one has finished.
M Massimiliano Member Licensed User Longtime User Sep 2, 2015 #5 My json data follow a changing my location marker over a gmap, so I need these almost in realtime. Only the latest query is the most important Upvote 0
My json data follow a changing my location marker over a gmap, so I need these almost in realtime. Only the latest query is the most important
M Massimiliano Member Licensed User Longtime User Sep 2, 2015 #6 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 Upvote 0
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
DonManfred Expert Licensed User Longtime User Sep 2, 2015 #7 add a value to your url and check the value on server side. Just use the last submitted (based on date given) then... Upvote 0
add a value to your url and check the value on server side. Just use the last submitted (based on date given) then...
M Massimiliano Member Licensed User Longtime User Sep 2, 2015 #8 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. Upvote 0
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.