Domanda

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?

È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top