Friday, February 26, 2016

WCF Timeouts

Timeouts can be configured on either the client side or the server side.  They are set on the binding element in the web.config file.  See here for the specific details.

Client side timeouts are pretty self explanatory.  If you don't receive the response in the specified time period, the connection is closed and your code moves on.  Server side timeouts work a bit differently than I expected.  First of all, when you set a server side timeout, you are saying "After the connection is opened up, if I don't receive the full request in the specified amount of time, I'm going to time out."  What it is not saying is "If I receive the request and it takes me longer than the specified time to process the request, I time out."  You'll just keep churning away probably until your database connection times out.  I believe client side timeouts are set to a minute by default, but can be lengthened.

No comments:

Post a Comment