作者:IronTech
链接:https://www.zhihu.com/question/20085992/answer/71742030
来源:知乎
著作权归作者所有,转载请联系作者获得授权。
下面的解释copy自quora,回答得很精彩
HTTP uses TCP connection. But HTTP uses only one TCP connection.
In HTTP, client initiates an HTTP session by opening a TCP connection to the HTTP server with which it wishes to communicate. It then sends request messages to the server, each of which specifies a particular type of action that the user of the HTTP client would like the server to take. The server responds to the client‘s request and sends the data which he wants. But HTTP uses only one TCP connection i.e. from client to server ,there is no TCP connection from server to client.The server sends data to client there is no guarantee that the client is going to get it.If client don‘t get the data in the TTL ( time to live) ,it again make a request for the data.
We need a reliable connection from client to server so that server can get all the requests made by the client.There is no need of reliable connection from server to client.If client doesn‘t get the data what he requests in the time ,he again makes requests for the data.