Personal understanding of three-way handshake and four-way handshake
Three-way handshake (connection establishment)
Client –> server (client initiates a connection request)
Server –> client (the server receives the client's request and allows the connection)
Client –> server (the client receives the permission command from the server and confirms the connection)
Four-way handshake (release)
Client –> server (client initiates a close request)
Server –> client (the server receives the client request and informs the client that it has received the request)
Server –> client (send close connection message)
Client –> server (the client receives the close connection message from the server, sends a message to the server, and the connection is completely released)