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.
Figure 1. Pascal declaration of connection
state type ConnectionStateType =
(
CONNECTIONclosing,
LISTENING,
NONEXISTENT,
OPEN,
RECEIVINGonly,
SENDINGonly,
TRYINGtoOPEN
);
- CONNECTIONclosing
- Indicates that
no more data can be transmitted on this connection, because it is
going through the TCP connection closing sequence.
- LISTENING
- Indicates that you are
waiting for a foreign site to open a connection.
- NONEXISTENT
- Indicates that a connection
no longer exists.
- OPEN
- Indicates that data can go
either way on the connection.
- RECEIVINGonly
- Indicates that data
can be received, but cannot be sent on this connection, because the
client has done a TcpClose.
- SENDINGonly
- Indicates that data can be sent
out, but cannot be received on this connection, because the foreign
application has done a TcpClose or equivalent.
- TRYINGtoOPEN
- Indicates that you
are trying to contact a foreign site to establish a connection.
Table 1 lists the TCP connection states.
Table 1. TCP connection statesTCP 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 |