Is it a better approach to close and re-open the WCF proxy , when we are re-using it?

659 views Asked by At

I am implementing an object pool for my WCF proxy. Once a proxy has been used, is it better if we close it down, kind of passivating it, so that its active connections are closed. When the proxy object is borrowed, we could re-open the proxy(activating) just before passing it. Will this approach have a performance hit?

1

There are 1 answers

0
Chris Dickson On

You can't "re-open" a closed proxy. A proxy implements ICommunicationObject and conforms to the standard state machine for communication objects in WCF. There is no transition from the Closed state back to the Open state.

If you decide to implement a pool for your proxies, they must remain in the Open state, or be discarded from the pool.