I am having use of the channel in some back worker thread .
The usage is once per two seconds and the connection is always to the same server.
What is the best approach will be:
A. Open channel once as the application starts and work with it during whole application life?
It can be several weeks at least.
B . Contract Channel Factory once and on each run of my worker thread open channel and at the end close it.
Thanks for ideas .
ChannelFactory is a perfect candidate for caching and reusing. So creating a static ChannelFactory is perfectly acceptable. On the other hand, channels may have timeouts, they may get into a corrupted state etc. So if you are willing to take care of all those side issues you can also cache the channels but in my experience, creating channels per communication is so cheap that it is a good practice to use a channel per communication.