ConnectionState is the current state of the connection. See Figure 1 for the Pascal declaration of the ConnectionStateType data type. ConnectionStateType is used in StatusInfoType and NotificationInfoType. It defines the client program view of the state of a TCP connection, in a form more readily usable than the formal TCP connection state defined by RFC 793. See Table 1 for the mapping between TCP states and ConnectionStateType.
ConnectionStateType =
(
CONNECTIONclosing,
LISTENING,
NONEXISTENT,
OPEN,
RECEIVINGonly,
SENDINGonly,
TRYINGtoOPEN
);
Table 1 lists the TCP connection states.
TCP State | ConnectionStateType |
---|---|
CLOSED | NONEXISTENT |
LAST-ACK, CLOSING, TIME-WAIT | If there is incoming data that the client program has not received, then RECEIVINGonly, otherwise CONNECTIONclosing. |
CLOSE-WAIT | If there is incoming data that the client program has not received, then OPEN, otherwise SENDINGonly. |
ESTABLISHED | OPEN |
FIN-WAIT-1, FIN-WAIT-2 | RECEIVINGonly |
LISTEN | LISTENING |
SYN-SENT, SYN-RECEIVED | TRYINGtoOPEN |