Timeouts WCF Services

我是研究僧i 提交于 2019-12-17 04:17:31

问题


How do the timeouts work in WCF? I know for example that you can configure sendTimeout and receiveTimeout for a clients binding. But how do they work?

MSDN describes sendTimeout as:

A TimeSpan value that specifies the interval of time provided for a send operation to complete. This value should be greater than or equal to Zero. The default is 00:01:00.

What are send operations/receive operations?


回答1:


Client side:

  • SendTimeout is used to initialize the OperationTimeout, which governs the whole interaction for sending a message (including receiving a reply message in a request-reply case). This timeout also applies when sending reply messages from a CallbackContract method.
  • OpenTimeout and CloseTimeout are used when opening and closing channels (when no explicit timeout value is passed).
  • ReceiveTimeout is not used.

Server side:

  • Send, Open, and Close Timeout same as on client (for Callbacks).
  • ReceiveTimeout is used by ServiceFramework layer to initialize the session-idle timeout.

The source is Brian McNamara on MSDN forums.




回答2:


See "Timeouts in WCF and their default values" http://blogs.msdn.com/b/hongmeig/archive/2010/03/06/timeouts-in-wcf-and-their-default-values.aspx

Timeouts on binding-SendTimeout, ReceiveTimeout, OpenTimeout and CloseTimeout. They can be set easily either through config or code on the Binding. The default value for those are 1 minute.

ServiceHost has OpenTimeout and CloseTimeout. Default for OpenTimeout is 1 minute, and default for CloseTimeout is 10 seconds.

Timeouts on client side channel. There is an OperationTimeout, which you can set it by casting the channel to IContextChannel. The default for this is also 1 minute. Ttimeout on tcp transport, called ChannelInitializationTimeout, and its default value is 5 seconds.

ASPNET. There are shutdown timeout, just like the service host close timeout, default is 90 seconds. ExecutionTimeout, just like our operation timeout, default is 110 seconds.




回答3:


In addition to what was on that post, there's also the Operation Timeout defined on the client end. See this:

http://final-proj.blogspot.com/2009/09/wcf-timeouts.html



来源:https://stackoverflow.com/questions/229760/timeouts-wcf-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!