6-2SectionUsing Socket Services with Socket Service Request Switches
107
Area until a socket is opened again. Writing data to the DM Area, however, is not
synced with writing to the Socket Status Areas, and timing may vary somewhat.
TCP connection status
– – – – – – – – – – – –
m+9 to m+16
1514131211109876543210
Status in indicated in bits 0 to 3 using the 1-digit hexadecimal codes shown in the
following table.
Code Status Meaning
0 CLOSED Connection closed.
1 LISTEN Waiting for connection.
2 SYN SENT Active and waiting for SYN.
3 SYN
RECEIVED
SYN sent and received.
4 ESTABLISHED Connection established.
5 CLOSE WAIT FIN received and waiting for close.
6 FIN WAIT1 Finished and FIN sent.
7 CLOSING Finished and FIN exchanged. Waiting for
acknowledgement of FIN arrival.
8 LAST ACK FIN received and finished. Waiting for acknowledgement
of FIN arrival.
9 FIN WAIT2 FIN arrival acknowledged. Waiting for FIN.
A TIME WAIT Finished and waiting for silence for twice the maximum
segment life (2MSL).
6-2-6 Socket Services and Socket Status
When using socket services, it is important to consider the timing of the status
changes in the Socket Status Area. The diagram below shows a flowchart for
opening UDP.