Accept occurs after three handshakes:

First handshake: A SYN packet (SYN = J) is sent from the client to the server.

Second handshake: When the server receives a SYN packet, it must acknowledge the client’s SYN (ACK =j+1) and send an ASK packet (ASK =k).

Third handshake: After receiving a SYN+ACK packet from the server, the client sends an ACK packet (ACK = K +1) to the server.

After the three-way handshake is complete, the client and server establish a TCP connection. You can then call the Accept function to obtain the connection.