Reputation: 712
According to RFC7540
9.1. Connection Management
HTTP/2 connections are persistent. For best performance, it is expected that clients will not close connections until it is determined that no further communication with a server is necessary (for example, when a user navigates away from a particular web page) or until the server closes the connection.
My Question is for the http2 implements of okhttp, when the tcp connection is closed? App go to background or?
Upvotes: 1
Views: 782
Reputation: 40593
This is controlled by OkHttp’s Connection Pool. It’ll be closed after 5 minutes of inactivity by default.
Upvotes: 1