I'm creating retry mechanism for URL request. I would like to send the request again if i didn't get ant answer after 10 seconds. The problem is how to deal with respone for the previous request in case it recieved after more than 10 seconds?

有帮助吗?

解决方案

I assume you are using URLLoader in order to send http requests. The loader has a close method. It's important to put it in try-catch, and also it's good to remove the listeners. This way even if there is a response with a delay, you won't get it. But best is to call close AND remove listeners :)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top