Is there a way to flush the DNS cache or force a host name in Adobe AIR / Flash?

It seems that AIR maintains its own DNS cache when the application starts and ignores any changes to the OS DNS cache (i.e. ipconfig / flushdns).

In particular, I have been creating several URLStream and URLRequest objects for a long period of time in an AIR application. After the first connection, the host IP address is cached for the entire life of the application. And the URLRequest.useCache property, for obvious reasons, does not affect DNS caching.

Does anyone know if this is possible or how to make the hostname re-resolve inside an AIR (or Flash) application?

Note. Unfortunately, resolving IP through a web service and rewriting a URL is not an option as a workaround. A usage example is downloading files from Amazon S3 using signed URLs that are not valid if they are changed.

Update: The test results above were compiled on WinXP prior to AIR 1.5.2. Subsequent tests using 1.5.2 show serialized requests with URLStream.load (), which are re-resolved more often but still ignore TTL values. I still do not understand what conditions are necessary to run re-authorization, but I noted several cases that prevent it. For example, if another asynchronous URLStream is active for the same host, then requests use a cached IP address and are not allowed. And just closing and dereferencing all threads to the host is not enough to guarantee that the same host name will be re-resolved in the next request.

+3
source share
1 answer

, , , AIR DNS, - , . .

, DNS. , , .

+1

Source: https://habr.com/ru/post/1714721/


All Articles