gpt4 book ai didi

c# - WCF 中 OperationTimeout 和 SendTimeout 的区别

转载 作者:可可西里 更新时间:2023-11-01 03:07:08 24 4
gpt4 key购买 nike

经过相当多的搜索,我找不到这个问题的答案。

OperationTimeout 之间的确切区别是什么?和 SendTimeout ?我读到 OperationTimeoutSendTimeout 的子集,SendTimeout 包括在 channel 中写入消息。如果您提供更多详细信息,那就太好了。

我的第二个问题是我有客户端调用服务,我只想在请求发送到服务器后不久和收到服务器回复后不久之间设置超时。如何设置这个超时?

最佳答案

我想建议阅读 this answer来自 Brian McNamara 在 MSFT 论坛上:

Brief summary of binding timeout knobs...

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.

关于c# - WCF 中 OperationTimeout 和 SendTimeout 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5303116/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com