开发者

wcf binding receiveTimeout

开发者 https://www.devze.com 2023-02-22 17:55 出处:网络
I have receiveTimeout in web config of wcf webservice, set to infinite. It doesn\'t work though, it takes the default value of 10 minutes. and the application crashes after that.

I have receiveTimeout in web config of wcf webservice, set to infinite. It doesn't work though, it takes the default value of 10 minutes. and the application crashes after that.

How and where can I catch this crash? and how to put a ping or reconnect ag开发者_如何学编程ain code there.

Or if is there a way to increase receivetimeout to infinite?


If you're setting the value in your config file then it's like this:

receiveTimeout="00:30:00"

I don't think it's a good idea to set it to the maximum value though. Try to set it to something reasonable.

If you really want infinite, enable reliable sessions on your binding.


You cannot set the Binding.ReceiveTimeout property to infinite. The maximum value you can set it to is TimeSpan.MaxValue that is slightly more than 10,675,199 days.


Set the timeout to max - 2147483647. Also, make sure you set the timeout for the client config as well.

See this thread for a good explanation of the different timeout values for WCF: http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/84551e45-19a2-4d0d-bcc0-516a4041943d

0

精彩评论

暂无评论...
验证码 换一张
取 消