When using OkHttp鈥檚 connection pool, if the DNS resolution of a target domain changes , how can existing established connections be made aware of and respond to these changes?
OkHttp only performs DNS resolution when opening a new connection.Existing connections in the pool continue to send requests to the old IP address as long as they are kept alive and not idle.If there is a steady flow of requests, connections never become idle, so keepAlive settings (maximum idle duration) have no effect on cleaning up these stale connections.
When using OkHttp鈥檚 connection pool, if the DNS resolution of a target domain changes , how can existing established connections be made aware of and respond to these changes?
OkHttp only performs DNS resolution when opening a new connection.Existing connections in the pool continue to send requests to the old IP address as long as they are kept alive and not idle.If there is a steady flow of requests, connections never become idle, so
keepAlivesettings (maximum idle duration) have no effect on cleaning up these stale connections.