超时 WCF 服务

发布于 2024-07-07 14:19:30 字数 285 浏览 7 评论 0原文

WCF 中的超时是如何工作的? 例如,我知道您可以为客户端绑定配置sendTimeoutreceiveTimeout。 但它们是如何工作的呢?

MSDN 将 sendTimeout 描述为:

TimeSpan 值,指定为某个事件提供的时间间隔 发送操作完成。 该值应该大于或等于 到零。 默认值为 00:01:00。

什么是发送操作/接收操作?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一江春梦 2024-07-14 14:19:30

客户端:

  • SendTimeout 用于初始化OperationTimeout,它控制发送消息的整个交互(包括在请求-回复情况下接收回复消息)。 当从 CallbackContract 方法发送回复消息时,此超时也适用。
  • OpenTimeout 和 CloseTimeout 在打开和关闭通道时使用(当没有传递显式超时值时)。
  • 未使用 ReceiveTimeout。

服务器端:

  • 发送、打开和关闭超时与客户端相同(对于回调)。
  • ServiceFramework 层使用 ReceiveTimeout 来初始化会话空闲超时。

来源是 Brian McNamara MSDN 论坛

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.

抚笙 2024-07-14 14:19:30

请参阅“WCF 中的超时及其默认值”http://blogs.msdn.com/b/hongmeig/archive/2010/03/06/timeouts-in-wcf-and-their-default-values.aspx

绑定超时 - SendTimeout、ReceiveTimeout、
打开超时和关闭超时。 它们可以通过以下方式轻松设置
绑定上的配置或代码。 这些的默认值为 1
分钟。

ServiceHost有OpenTimeout和CloseTimeout。 OpenTimeout 的默认值
为 1 分钟,CloseTimeout 默认为 10 秒。

客户端通道超时。 有一个OperationTimeout,它
您可以通过将通道强制转换为 IContextChannel 来设置它。 默认
这也是 1 分钟。 TCP 传输上的 Ttimeout,称为
ChannelInitializationTimeout,默认值为5秒。

ASP.NET。 有关闭超时,就像服务主机关闭一样
超时,默认90秒。 ExecutionTimeout,就像我们的
操作超时,默认110秒。

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.

爱她像谁 2024-07-14 14:19:30

除了那篇文章中的内容之外,还有客户端定义的操作超时。 请参阅:

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文