【问题标题】:What is the maximum value for timeout attributes in httpbinding in WCFWCF中httpbinding中超时属性的最大值是多少
【发布时间】:2023-03-02 22:36:02
【问题描述】:

我的配置如下。

<bindings>
      <basicHttpBinding>
        <!-- This binding is used when connecting to services secured using SSL (e.g. when accessible over internet/WAN) -->
        <binding name="SecuredBasicHttpBinding" closeTimeout="10675199.02:48:05.4775807"
          openTimeout="10675199.02:48:05.4775807" receiveTimeout="10675199.02:48:05.4775807" sendTimeout="10675199.02:48:05.4775807"
          maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
          <readerQuotas maxStringContentLength="16384" />
          <security mode="Transport">
            <transport clientCredentialType="Basic" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>

我想为 closetimeout、opentimeout..etc 设置最大值。 我从下面的 url 得到这个值 10675199.02:48:05.4775807。但它没有用。

How can I set the receiveTimeout and sendTimeout to infinity with this WCF contact?

可以设置的超时最大值是多少?

【问题讨论】:

  • 我不直接知道答案,但我想建议您三思而后行。目的是什么?想要无限期地等待“答案”。
  • 什么实际上不起作用?编译时错误?运行时错误?
  • 实际上我的一些服务正在返回超时预期,所以想要设置超时的最大值就是目标
  • 我不应该将其设置为最大值。那是多长时间?你要等待最大值吗?考虑根据操作的长度将其设置为实际值。恕我直言,也许 1 或 5 分钟已经很多了。

标签: wpf wcf


【解决方案1】:

This post 表示最大超时时间接近 25 天。祝你好运! :p

正如我之前提到的,考虑将其设置为现实的时间跨度,并在响应超时时采取适当的措施。

【讨论】:

    【解决方案2】:

    最大超时值是有符号 32 位整数的最大值:2147483647

    【讨论】:

      猜你喜欢
      • 2020-10-15
      • 2017-11-15
      • 2014-12-31
      • 1970-01-01
      • 1970-01-01
      • 2013-05-31
      • 2013-05-14
      • 1970-01-01
      • 2011-08-20
      相关资源
      最近更新 更多