4

Why does the RFC require peers to send a close frame and then wait for a close frame from the peer? Why not just send the frame and then close the TCP connection?

nhooyr
  • 1,104
  • 1
  • 13
  • 31
  • https://tools.ietf.org/html/rfc6455#section-7.1.1 – cassiomolin Sep 14 '18 at 15:34
  • According to the RFC, its so the client doesn't end up in CLOSE_WAIT and can reopen the connection with the same port but that seems a weak reason. We have many, many free ports on clients as well as servers. Is there any other reason? (Wondering whether I should bother implementing the close handshake in my ws library) – nhooyr Sep 14 '18 at 22:01

0 Answers0