What's the relationship between the two concepts?

Is one HTTP Keep-Alive connection always over a long persistent TCP connection? When the HTTP connection is closed, will the TCP connection be closed at the same time?

Or can multiple HTTP requests, including Keep-Alive ones, run over a single TCP connection?

1 Answer 1


Is one http keepalive connection always over a long persistent tcp connection

There is no such thing as a "persistent" TCP connection. All TCP connections persist from connection start to close.

When the http connection closed , will the tcp connection be closed at the same time?

There is no concept of "close connection" for HTTP. HTTP knows only requests and responses and an exchange is done the request is fully send and the response is fully received. With keep-alive you can have multiple such exchanges inside a single TCP connection.

Close of TCP connection means close of HTTP connection, but there is no explicit close of the HTTP connection.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.