The Client closes the connection by sending a CloseSecureChannel request and closing the socket gracefully. When the Server receives this Message, it shall release all resources allocated for the channel. The body of the CloseSecureChannel request is empty. The Server does not send a CloseSecureChannel response.
If security verification fails for the CloseSecureChannel Message, then the Server shall report the error and close the socket.
The sequence of Messages when closing an OPC UA Connection Protocol connection is shown in Figure 15.
Figure 15 – Closing a OPC UA Connection Protocol connection
The Server application does not do any processing when the SecureChannel is closed; however, the Stack shall provide notifications to the Server application whenever a CloseSecureChannel request is received or when the Stack cleans up an abandoned SecureChannel.