3

In WCF, does a timeout on a request-response operation fault the channel at the client's end?

If a server times out when sending a response, is the channel faulted at the server's end?

Paul Turner
  • 38,949
  • 15
  • 102
  • 166

3 Answers3

6

Yes, a timeout will fault the channel - and there's always only one channel linking a client and a server - the server doesn't have a channel of its own...

You basically have:

+-----------+                       +-----------+
|           |_______________________|           |
|  Client   |     The Channel       |  Server   |
|           |-----------------------|           |
+-----------+                       +-----------+

There's really only one channel which connects the two bits. As for timeouts - if both ends define a different value for the same timeout, the smaller value will "win" and become relevant - the higher value (on the other end) isn't taken into account.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • Perhaps it's just how I've expressed it, but I meant from the perspective of each system. If a timeout is experienced from either end of the channel, will the channel be faulted for the "timed out" party in both cases? – Paul Turner Apr 15 '10 at 15:53
  • yes - the smaller values for each timeout will "win" - if you have 100 years timeout on your client, but your server is set to 5 seconds - the channel between the two will fault after 5 seconds. – marc_s Apr 15 '10 at 15:55
  • 3
    Your ASCII art is hideous, yet enlightening. Thanks. – Paul Turner Apr 15 '10 at 16:00
  • @marc_s, Are there any instances when a timeout would not fault the channel? I'm not seeing this: http://stackoverflow.com/q/13402977/546561 – Eric Nov 15 '12 at 17:39
1

Correct, the timeout will fault the channel. You can set the max timeout time on both the client and the server side.

ChrisNel52
  • 14,655
  • 3
  • 30
  • 36
0

It depends which Timeout.

If you hit the SendTimeout or ReceiveTimeout of your binding (in my case NetTcpBinding), then yes, the channel will fault.

BUT, if you hit the OperationTimeout of your Service (in my case DuplexChannel) then you will just get a TimeoutException and the channel will NOT fault.

toATwork
  • 1,335
  • 16
  • 34