![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | 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) |
| Guest | 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) |
| Guest | 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) |
| Guest | 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 | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Closing WLM | Jane Doe | Live Mail | 7 | 05-27-2008 01:13 PM |
| Closing a DVD-RW | BobC | Vista General | 0 | 02-06-2008 01:00 PM |
| DEP keeps closing IE7, what's gives? | Mesquire | Vista security | 11 | 11-17-2007 09:36 AM |
| Windows Mail keeps closing because DEP is closing for security | Window Mail DEP message | Vista mail | 7 | 05-23-2007 05:59 AM |
| closing lid | =?Utf-8?B?c2F1LmJhZXI=?= | Vista General | 2 | 09-22-2006 11:07 AM |