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.

Connection best practice

More
22 May 2021 17:38 #9694 by support
Replied by support on topic Connection best practice
Hello,

the question is more about EasyXXClient object lifetime practices, and not (as titled) about "connections", because the connections are handled commonly for multiple EasyXXClient objects (shared), and thus not directly related to the lifetime of EasyXXClient objects.

I suggest the following rule:

If you can prevent it, do not create very high numbers of EasyXXClient objects in total (I mean hundreds or thousands ) or create them with very high frequency (let's say 10 per second or more). But having a handful of EasyXXClient objects, or maybe 50 or 100 or so, or having just one, is all OK.

As a less important note, if you create an EasyXXClient object and no longer need it, you do not have necessarily call the IDisposable.Dispose (which is what the 'using' block does at the end), even though the documented contract to IDisposable tells you that it is mandatory.

Best regards

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

More
22 May 2021 12:09 #9692 by DarrenYoung
I've not been able to find anything in the documentation regarding this.

What is the best practice for creating EasyOPC clients? Should we create one, in a using block, each time we want to perform a read/write or should we have one long running instance?

Thanks in advance

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

Moderators: support
Time to create page: 0.050 seconds