![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | WCF; closing client General question; WCF clients - do these (broadly) pool? My assumption is "no". Specifically, if I am expecting to perform additional requests shortly, should I close the client and re-obtain when needed, or leave it open and re-use it? I would lean towards the latter, unlike (for instance) SqlConnections which I would generally close/dispose and let the pool worry about it... Even if it doesn't pool, is the overhead significant in closing each time versus re-using? Cheers, Marc |
My System Specs![]() |
| | #2 (permalink) |
| | Re: WCF; closing client additional; relating in particular to IIS-hosted "svc" style services, using transport encryption and without any security negotiations [for compatibility with existing systems, security handled via bespoke extensions / headers] Marc |
My System Specs![]() |
| | #3 (permalink) |
| | Re: WCF; closing client Thus wrote Marc, > General question; WCF clients - do these (broadly) pool? My assumption > is "no". That's right. Closing the client prematurely can also terminate a session or a secure conversation, which is quite expensive to establish. > Specifically, if I am expecting to perform additional requests > shortly, should I close the client and re-obtain when needed, or leave > it open and re-use it? I would lean towards the latter, unlike (for > instance) SqlConnections which I would generally close/dispose and let > the pool worry about it... In this scenario (and especially when using more expensive binding features) you should reuse your clients, but also monitor their states closely using the lifecycle events of ClientBase<T>. Once a client has faulted, call Abort() on it to avoid leaking resources, and replace it with a fresh instance. See http://msdn2.microsoft.com/en-us/library/ms734653.aspx for further details. Cheers, -- Joerg Jooss news-reply@joergjooss.de |
My System Specs![]() |
| | #4 (permalink) |
| | Re: WCF; closing client Thankyou - I think that confirms my thoughts... unfortunately the "always close" warning on generated classes doesn't make this very clear ;-p Cheers, Marc |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| dat keeps closing ie8 | Vista security | |||
| Windows Mail keeps closing because DEP is closing for security | Vista mail | |||
| Closing Down | General Discussion | |||
| Closing WLM | Live Mail | |||
| closing lid | Vista General | |||