��¼��TCP���ӵ�״̬
- LISTEN:���ȷ������Ҫ��һ��socket���м�����״̬ΪLISTEN. /* The socket is listening for incoming connections. ��������Զ��TCP�˿ڵ��������� */
- SYN_SENT:�ͻ���ͨ��Ӧ�ó������connect����active open.���ǿͻ���tcp����һ��SYN��������һ������.֮��״̬��ΪSYN_SENT. /*The socket is actively attempting to establish a connection. �ڷ������������ȴ�ƥ����������� */
- SYN_RECV:�����Ӧ����ACKȷ�Ͽͻ��˵�SYN,ͬʱ�Լ���ͻ��˷���һ��SYN.֮��״̬��ΪSYN_RECV /* A connection request has been received from the network. ���յ��ͷ���һ�����������ȴ������������ȷ�� */
- ESTABLISHED: ����һ�������ӣ�˫�����Խ��л��Ѿ������ݽ����ˡ�/* The socket has an established connection. ����һ�������ӣ����ݿ��Դ����û� */
- FIN_WAIT1:�����ر�(active close)��Ӧ�ó������close��������TCP����FIN���������ر����ӣ�֮�����FIN_WAIT1״̬./* The socket is closed, and the connection is shutting down. �ȴ�Զ��TCP�������ж�������ǰ�������ж������ȷ�� */
- CLOSE_WAIT:�����ر�(passive close)��TCP�ӵ�FIN�ͷ���ACK�Ի�ӦFIN����(���Ľ���Ҳ��Ϊ�ļ����������ݸ��ϲ�Ӧ�ó���),������CLOSE_WAIT. /* The remote end has shut down, waiting for the socket to close. �ȴ��ӱ����û������������ж����� */
- FIN_WAIT2:�����رն˽ӵ�ACK�ͽ�����FIN-WAIT-2 ./* Connection is closed, and the socket is waiting for a shutdown from the remote end. ��Զ��TCP�ȴ������ж����� */
- LAST_ACK:�����رն�һ��ʱ����յ��ļ���������Ӧ�ó�����CLOSE�ر����ӡ��������TCPҲ����һ�� FIN,�ȴ��Է���ACK.�ͽ�����LAST-ACK . /* The remote end has shut down, and the socket is closed. Waiting for acknowledgement. �ȴ�ԭ������Զ��TCP�������ж������ȷ�� */
- TIME_WAIT:�������رն˽��յ�FIN��TCP�ͷ���ACK����������TIME-WAIT״̬��/* The socket is waiting after close to handle packets still in the network.�ȴ��㹻��ʱ����ȷ��Զ��TCP���յ������ж������ȷ�� */
- CLOSING: �Ƚ��ټ�./* Both sockets are shut down but we still don't have all our data sent. �ȴ�Զ��TCP�������жϵ�ȷ�� */
- CLOSED: �����رն��ڽ��ܵ�ACK���ͽ�����closed��״̬�����ӽ���./* The socket is not being used. û���κ�����״̬ */