Close Connection (CC) instruction
(see instruction description format info here)
|Function:||Makes the DS close the data connection with the network host, reset buffer overflow flags|
|Parameter (P) cmd format:||PCC|
|First introduced:||Earlier than "baseline" V3.14/V3.51|
|See also:||Ethernet port and network communications, Establish Connection (CE) instruction.|
Close Connection instruction makes the DS close current data connection (if existed) and also reset routing buffers overflow flags (overflows are displayed by the status LEDs , overflow status is also returned by the Echo (X) command - see S and E flags).
As a result of Close Connection instruction execution UDP data "connections" are simply discarded. TCP data connections are properly shut down (using FIN-ACK-FIN-ACK sequence).
Close Connection instruction can be used at any time, even if the data connection is already closed and if the data connection was not established by the DS itself (i.e. it was a passive open).
OK (A) reply code is returned if command is accepted. This does not mean that the connection has been shut down already, only that the DS has accepted the command. Actual connection status can be verified at any time using the Echo (X) command (see c flag).
Another instruction- Abort Connection (CA) - can be used to abort the TCP connection (using the RST packet). For UDP data "connections" there is no difference between the Close Connection instruction and the Abort Connection (CA) instruction .