DEV Community

TianZhen
TianZhen

Posted on • Originally published at youth2009.org on

TCP FIN_WAIT_2, TIME_WAIT and CLOSE_WAIT

Serverå’ŒClient都可以关闭已建立的连接,有可能Server先关闭,有可能Client先关闭,有可能同时关闭。同时关闭不太常见,Server关闭也不太常见(Server觉得有些Clientä¸€ç›´ä¿æŒç€è¿žæŽ¥å ç”¨èµ„æºï¼Œå…³é—­äº†æŸäº›Client的连接,一般来说Server是做服务的,不会主动断开,除非是某些特别的需要),Client先关闭比较常见。

Client先关闭的情况:https://benohead.com/tcp-about-fin_wait_2-time_wait-and-close_wait/

Server先关闭的情况:https://benohead.com/c-understanding-close_wait-and-fin_wait_2/

同时关闭连接的情况:http://www.tcpipguide.com/free/t_TCPConnectionTermination-4.htm

Top comments (0)