Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

OPC orderly close on unexpected application crash

More
10 Sep 2015 12:48 - 10 Sep 2015 12:49 #3560 by support
I have not tested with all these scenarios, and frankly, the answer is beyond what a standard managed library (like QuickOPC) can or is supposed to do.

According to articles on the Web (e.g. those listed further below), a standard .NET console app behavior after Ctrl+C would be that the finalizers do not run, and therefore cleanup will not be processed. There may be a way to change this behavior; it's up to you to do so, if required.

A process termination ("kill", e.g. from Task Manager, or by other means) is a process termination. That means, to my knowledge, it is (by definition) impossible to attach any handling to it - otherwise it wouldn't be a process termination.

We do not have an event indicating a cleanup. But you can relatively safely assume that if any other finalizers in the app domain run, that ours ran as well.

Some related links:
Best regards
Last edit: 10 Sep 2015 12:49 by support.
The following user(s) said Thank You: MAJLGC

Please Log in or Create an account to join the conversation.

More
10 Sep 2015 04:51 - 10 Sep 2015 04:54 #3559 by MAJLGC
Thanks very much for your detailed answer. Two more questions arise.
1 - If OPC Client console application is killed with a CTRL-C or Task Administrator Kill, will EasyXXClient perform the same cleanup?
2 - It is possible to log that a right EasyXXClient clean up was performed on OPC Client console application exit (Normal, Crash, CTRL+C, TaskKill)?
Last edit: 10 Sep 2015 04:54 by MAJLGC.

Please Log in or Create an account to join the conversation.

More
09 Sep 2015 12:41 #3558 by support
Well, the answer is "it depends". It depends on the kind of crash - and there are many of them.

If, for example, a regular .NET exception is unhandled and terminates the program, the CLR usually finalizes all objects (although it gives no guarantee), and as part of that, our EasyXXClient objects will unsubscribe and disconnect orderly. There are other crashes possible that are worse than that, and in such case the above may not happen. In some cases, I believe, nothing can be done at all; in some cases, you may try to improve on that, but that would be up to you.

Note that COM/DCOM helps with the cleanup as well. For example, if you are connecting to a remote server, and either the client or the server crasher or becomes unaccessible (long network interruption), DCOM will eventually (roughly after 6 minutes) give up on any outstanding calls, will declare the client or server side "dead", and *also* call a proper number of IUnknown::Release()-s on the interfaces of the remaining COM objects. This assures proper cleanup even in case of crash. I am not sure whether this is happening with local connections as well, though.

Best regards
The following user(s) said Thank You: MAJLGC

Please Log in or Create an account to join the conversation.

More
09 Sep 2015 07:09 - 09 Sep 2015 07:12 #3557 by MAJLGC
In case of a console application crash:
- ¿How OPC OPCClient handles actual items subscription?
- ¿How the OPC server releases former OPCClient subcription?
- ¿Is it posible to configure an application exit handler to manage and orderly close (Unsubcribe OPC Items and closing OPCClient?
Last edit: 09 Sep 2015 07:12 by MAJLGC.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.056 seconds