4

I wanted to know, who will initiate the closing of the TCP connection in below two scenarios?

  1. if HTTP request has a header "Connection: close" in it.
  2. if HTTP response has a header "Connection: close" in it.

I saw answer for Connection Close for HTTP request response but it doesn't answer clearly the question one in that question.

NPE
  • 432
  • 5
  • 13
  • In my opinion, it does clearly answer the question one, it says right there that the client is what sends TCP FIN, gets TCP ACK, gets TCP FIN and sends TCP ACK, connection closed, right in that order – Expolarity Sep 30 '20 at 12:00
  • Also, on the [header reference at developer.mozzila.org](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Connection), it states clearly "Indicates that either the client or the server would like to close the connection." this would inturn mean that the recieving side of the request should close the connection – Expolarity Sep 30 '20 at 12:04
  • From my own experience, clients are usually fine if the server closes connection after receiving a response. – Expolarity Sep 30 '20 at 12:09
  • Thank you @Expolarity, for the quick response, and I read the answer again and also rfc, so it does not clearly mention that who will close the connection, so anyone can close the connection. – NPE Sep 30 '20 at 14:36

0 Answers0