mushroomsir.github.io icon indicating copy to clipboard operation
mushroomsir.github.io copied to clipboard

time_wait 原理分析和优化

Open mushroomsir opened this issue 4 years ago • 0 comments

https://mushroomsir.github.io/timewait_analyzes/

TCP 连接关闭时,会有 4 次通讯(四次挥手),来确认双方都停止收发数据了。如上图,主动关闭方,最后发送 ACK 时,会进入 TIME_WAIT 状态,要等 2MSL 时间后,这条连接才真正消失。TCP 的可靠传输机制要求,被动关闭方(简称 S)要确保最后发送的 FIN K 对方能收到。

mushroomsir avatar Oct 18 '20 12:10 mushroomsir