TCP Socket States

Socket - the instantiation of an end-point in a potential TCP connection

Listen - a TCP socket is ready and listening for incoming connections

SYN_SENT - a synchronization request has been sent, but the connection has not been established yet

SYN-RECEIVED - a socket previously in a LISTEN state has received a synchronization request and sent a SYN/ACK back

ESTABLISHED - the TCP connection is in working order and both sides are free to send each other data

FIN_WAIT - a FIN has been sent, but the corresponding ACK from the other end has not been received yet

CLOSE_WAIT - the connection has been closed at the TCP layer, but that the application that opened the socket has not released its hold on the socket yet

CLOSED - the connection has been fully terminated and that no further communication is possible