hongshuwei
hongshuwei

Reputation: 712

When tcp connection is closed for http2 of okhttp

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

Answers (1)

Jesse Wilson
Jesse Wilson

Reputation: 40593

This is controlled by OkHttp’s Connection Pool. It’ll be closed after 5 minutes of inactivity by default.

Upvotes: 1

Related Questions