- 论坛徽章:
- 1
|
SOCKET TIME_WAIT问题?
[quote]原帖由 "m4a1"]但是,仅仅连接不WRITE,就不会出现TIME_WAIT,[/quote 发表:
这个状态的出现是由tcp分节引起的,与应用数据无关。
下面是个例子,自己看看具体的过程
- from CLOSE_WAIT based on whether the application issues a close or a
- close_swap.
- The current passive close path is:
- server client
- -----------------------------------------------------------
- ESTABLISHED ESTABLISHED
- (get application close)
- goto FIN_WAIT_1
- send FIN ---FIN--->;
- goto CLOSE_WAIT
- <---ACK--- send ACK
- goto FIN_WAIT_2
- (get application close)
- goto LAST_ACK
- <---FIN--- send FIN
- goto TIME_WAIT
- send ACK ---ACK--->;
- goto CLOSED
- This solution adds this branch from CLOSE_WAIT on the client side:
- server client
- -----------------------------------------------------------
- ESTABLISHED ESTABLISHED
- (get application close)
- goto FIN_WAIT_1
- send FIN ---FIN--->;
- goto CLOSE_WAIT
- <---ACK--- send ACK
- goto FIN_WAIT_2
- (get application close_swap)
- goto LAST_ACK_SWAP
- <---FIN--- send FIN
- goto TIME_WAIT
- send ACK ---ACK--->;
- goto TIME_WAIT
- <---RST--- send RST
- goto CLOSED
复制代码 |
|