Frage

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?

War es hilfreich?

Lösung

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 :)

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top