mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +08:00
net/tcp: add support for the CLOSE_WAIT state
CLOSE-WAIT - represents waiting for a connection termination request
from the local user.
TCP A TCP B
1. ESTABLISHED ESTABLISHED
2. (Close)
FIN-WAIT-1 --> <SEQ=100><ACK=300><CTL=FIN,ACK> --> CLOSE-WAIT
3. FIN-WAIT-2 <-- <SEQ=300><ACK=101><CTL=ACK> <-- CLOSE-WAIT
4. (Close)
TIME-WAIT <-- <SEQ=300><ACK=101><CTL=FIN,ACK> <-- LAST-ACK
5. TIME-WAIT --> <SEQ=101><ACK=301><CTL=ACK> --> CLOSED
6. (2 MSL)
CLOSED
in the current state, we can continue to send data until the user
calls shutdown or close, then directly enter the TCP_LAST_ACK state
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
@@ -88,9 +88,10 @@
|
||||
# define TCP_ESTABLISHED 0x04
|
||||
# define TCP_FIN_WAIT_1 0x05
|
||||
# define TCP_FIN_WAIT_2 0x06
|
||||
# define TCP_CLOSING 0x07
|
||||
# define TCP_TIME_WAIT 0x08
|
||||
# define TCP_LAST_ACK 0x09
|
||||
# define TCP_CLOSE_WAIT 0x07
|
||||
# define TCP_CLOSING 0x08
|
||||
# define TCP_TIME_WAIT 0x09
|
||||
# define TCP_LAST_ACK 0x0a
|
||||
# define TCP_STOPPED 0x10 /* Bit 4: stopped */
|
||||
/* Bit 5-7: Unused, but not available */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user