I use HTTPUtils for several things in my app. For the most part it works great but on rare occasions I have an issue. I haven't ruled out a problem at the source (of the information I am retrieving) but I want to be sure the way I am handling it isn't the problem.
Basically I add a bunch of URLs to a job then execute the job. These URLs (it can be anywhere from a few to 50 or more) send HTTP requests to a satellite receiver on the local network and the receiver responds back with the results.
In the UrlDone sub I check to see that there is text in the result and if so, it then passes that response to a sub that parses the JSON response extracting the information I am looking for and then adds that information to a list (and/or listview).
9 times out of 10 this works without a hitch, but occasionally the job will finish but one or more of the results don't get processed. When this happens, if I try again (clear my lists and start the job over / "refresh") usually all of the results come in.
I can post the relevant code if necessary, but I am just wondering if it is possible that maybe while another sub is processing a previous response that it could maybe cause a UrlDone event to be missed? Or maybe the sub that processes the response gets called again before it is finished processing a previous response? These seem like newbie questions and I wouldn't think this could happen but it's strange that this usually works but not always. One thing I will have to do is add some logging info to get a better idea of what is going on but I just wanted to see what others thought about this or if anyone else has had these problems. I have the timeout set to 30 seconds, which should be plenty on a local network.
Bonus question: Does JobDone get raised after the last URL response is received or just after the last URL request/post has been made? In other words, is it possible to get the JobDone event before all URLDone events have come back?
Basically I add a bunch of URLs to a job then execute the job. These URLs (it can be anywhere from a few to 50 or more) send HTTP requests to a satellite receiver on the local network and the receiver responds back with the results.
In the UrlDone sub I check to see that there is text in the result and if so, it then passes that response to a sub that parses the JSON response extracting the information I am looking for and then adds that information to a list (and/or listview).
9 times out of 10 this works without a hitch, but occasionally the job will finish but one or more of the results don't get processed. When this happens, if I try again (clear my lists and start the job over / "refresh") usually all of the results come in.
I can post the relevant code if necessary, but I am just wondering if it is possible that maybe while another sub is processing a previous response that it could maybe cause a UrlDone event to be missed? Or maybe the sub that processes the response gets called again before it is finished processing a previous response? These seem like newbie questions and I wouldn't think this could happen but it's strange that this usually works but not always. One thing I will have to do is add some logging info to get a better idea of what is going on but I just wanted to see what others thought about this or if anyone else has had these problems. I have the timeout set to 30 seconds, which should be plenty on a local network.
Bonus question: Does JobDone get raised after the last URL response is received or just after the last URL request/post has been made? In other words, is it possible to get the JobDone event before all URLDone events have come back?