1

I just want to make sure I'm following the right approach. In my application for particular service I have one static ChannelFactory (as it's instance thread safe), and every time I need to comunicate with WCF Service I create a channel with CreateChannel , use that channel and then close it. However I bumped into one opinion that storing channel itself in static member, and reusing it is also right (author of that opinion also claims that creation of channels on PerCall basis will decrease performance significantly). What's the best approach?

Thanks,Pawel

4

1 回答 1

2

好吧,我建议您进行自己的性能测试,但我认为您会发现使用您的方法,根据您的硬件,每秒创建数千个通道不会有任何问题。在我看来,对于大多数用例来说,这根本不重要。

如果您有兴趣,Michele Bustamante(来自 IDesign.net)将在这里与代码示例一起讨论

于 2011-04-11T20:35:44.393 回答