QuickOPC objects whose type names end with Parameters or Descriptor are always light-weight objects that do not consume anything above a piece of managed memory. You are free to create and recreate them as needed, without unreasonable "cost".
EasyDAClient objects are somewhat different. When you have multiple instances of EasyDAClient, they are designed so that internally they share many data, and connections to the target servers. But still, each instance requires things like separate threads for event notifications etc., and also is relatively heavy in terms of set-up and tear-down.
Of the two methods you proposed, I suggest to use
" a parent method that each time calls an existing instance EasyDAClient (eventually a singleton) with its own EasyDAInstanceParameters and ServerDescriptor".
The connections are closed automatically, in the background, after a configurable period of inactivity. You do not have to do anything in your code for it to happen. Although calling Dispose is "contractually" required on anything that implements IDisposable (and, therefore, on EasyDAClient as well), in our implementation we do not require you to call it.
I would know what is the best way to get values using ReadMultipleItems:
- a parent method that each time recreate an EasyDAClient with its own EasyDAInstanceParameters and ServerDescriptor
- a parent method that each time calls an existing instance EasyDAClient (eventually a singleton) with its own EasyDAInstanceParameters and ServerDescriptor
Finally, in both cases, it is sufficient use dispose() to free resource and close correctly the connections? Otherwise how is it possible?
Thanks in advance,