简体   繁体   中英

Http Request/Response Tcp connection

I was studying http protocol in detail and come across this tutorial. I think when http request is made, a TCP connection is established b/w client(browser) and server. On that TCP connection http request data is sent, on server side http request is parsed and on the same TCP connection http response is sent. After response is sent, TCP connection is terminated. For next http request a new TCP connection will be established. But below tutorial saying something else. Am I right or wrong?

在此处输入图片说明

HTTP is stateless, not connection-less. That paragraph is wrong, the connection is connected until, at least, the response is sent back to the caller. In practice, the same connection is reused if several requests to the same endpoint needs to be done, and since HTTP/1.1 is it possible to send many requests at once and wait for responses in the same order.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM