R.
We do not have any special code or detection for any of the cases listed. We simply use whatever the operating system or the OPC servers gives us. Therefore we cannot give guarantees to how it will behave.
For 1), the outcome will depend on whether during the computer shutdown sequence, the OPC Server will issue a request to its OPC Clients to disconnect. If so, we will report a COMException with error code 0xC0049006 (-1073442810), with error message “Server shut down. The OPC server indicated that it needs to shut down. The application is releasing all connections and interfaces for this server. The application will try to reconnect to the server after a configurable period.”. If the OPC server does not issue the disconnect request (using IOPCShutdown), the behavior will be probably similar to that of 2) below.
Assuming that for 2), the customer means a network cable between the OPC client and server machine, then the most likely outcome is that we will report a COMException with error code 0x800706BA (-2147023174), which is RPC_E_UNAVAILABLE (error message “The RPC server is unavailable.”).
Ad 3), if this is about a communication failure between the OPC Server and its device, the behavior depends on the OPC Server, but most likely there will be no exception, but the OPC Quality will be Bad (QUAL_BAD, 0x0000) with a substatus QUAL_COMM_FAILURE (0x0018), i.e. 24 in decimal.
Best regards,