WCF Channel Lifetime with Repeated Calls

Perhaps this is an obvious question, maybe not. Imagine a GUI application where each button is pressed calls another function on the remote WCF service. Using buttons often occurs approximately every few seconds. In general, is it best to open and close the WCF channel with every function call, or open the channel for the entire life of the application? Assuming, of course, that there are only a few instances of this application.

NB. This question is not really about an example, but about helping me come up with best practice here.

+3
source share
2 answers

, WCF, , \ . , , ( , 2 ).

+1

- , .

:, , (, IErrorHandler ) SOAP, .

"" .NET, ( ) → .. .

( .State), , , - .

+2

Source: https://habr.com/ru/post/1727446/


All Articles