The proxy isn't faulted after a timeoutexception, and i can still use it.
Is it recommended to use that proxy or should i abort it and create a new one?

- 21
- 2
-
As long as the channel isn't faulted (because of an exception on the service side) you should be fine to keep using it. – marc_s Jun 04 '11 at 13:22
2 Answers
I would say bin it. One of the particular problems with a timeout is that you don't know what happened at the other end, since your client gave up listening. If you have a stateful connection, all bets are now off.
If you are stateless, you can probably get away with it. In either event, you might way to validate the current status if you timed out while performing an operation that affects data. If you were just querying data things are simpler.

- 1,026,079
- 266
- 2,566
- 2,900
Why should we ever reuse a proxy instance?
Creating a proxy is not an expensive operation. Nothing is really done until you make a request to the service.
Besides reusing it means checking for faulted state of it every time before making another request.
If you have a sign in/out architecture you could as well cache the token that is returned after sign in and use it for subsequent requests.

- 4,653
- 29
- 31
-
That is not always true - recreating proxy can be pretty expensive operation if you define endpoint / binding in the code because it always creates new `ChannelFactory`. Also in case of .NET 3.0 it is costly always. – Ladislav Mrnka Jun 04 '11 at 14:06