Internet domain socket states:
CLOSED: The socket is not in use.
LISTEN: The socket is listening for incoming connections. Unconnected
listening sockets like these are only displayed when using the -a option.
SYN_SENT: The socket is actively trying to establish a connection to a
remote peer.
SYN_RCVD: The socket has passively received a connection request from a
remote peer.
ESTABLISHED: The socket has an established connection between a local
application and a remote peer.
CLOSE_WAIT: The socket connection has been closed by the remote peer,
and the system is waiting for the local application to close its half of
the connection.
LAST_ACK: The socket connection has been closed by the remote peer, the
local application has closed its half of the connection, and the system
is waiting for the remote peer to acknowledge the close.
FIN_WAIT_1: The socket connection has been closed by the local
application, the remote peer has not yet acknowledged the close, and the
system is waiting for it to close its half of the connection.
FIN_WAIT_2: The socket connection has been closed by the local
application, the remote peer has acknowledged the close, and the system
is waiting for it to close its half of the connection.
CLOSING: The socket connection has been closed by the local application
and the remote peer simultaneously, and the remote peer has not yet
acknowledged the close attempt of the local application.
TIME_WAIT: The socket connection has been closed by the local
application, the remote peer has closed its half of the connection, and
the system is waiting to be sure that the remote peer received the last
acknowledgement.
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-toJimOvv-1597509572365)(/Users/ldd/Documents/typora_note/assets/tcp_state.png)]
source from ldd
本文详细解析了TCP连接的各个状态,包括CLOSED、LISTEN、SYN_SENT等,阐述了每个状态的含义及如何从一个状态过渡到另一个状态,为理解网络通信提供了深入视角。
1834

被折叠的 条评论
为什么被折叠?



