Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 会话超时差异_C#_Asp.net_Wcf_Session_Timeout - Fatal编程技术网

C# 会话超时差异

C# 会话超时差异,c#,asp.net,wcf,session,timeout,C#,Asp.net,Wcf,Session,Timeout,我正在为一个相当大的项目提供支持。我的任务是将会话超时更改为比现在更长的时间。现在,他们在大约10分钟后注销。我已经发现了很多不同的东西,我需要一些帮助来弄清楚它们都做了什么 首先,我得到了这个: <sessionState mode="InProc" timeout="240" cookieless="UseCookies" /> 这是240分钟后触发的,所以不可能是这个。 然后我得到了这个: <binding name="WSHttpBinding_IFootp

我正在为一个相当大的项目提供支持。我的任务是将会话超时更改为比现在更长的时间。现在,他们在大约10分钟后注销。我已经发现了很多不同的东西,我需要一些帮助来弄清楚它们都做了什么

首先,我得到了这个:

 <sessionState mode="InProc" timeout="240" cookieless="UseCookies" />

这是240分钟后触发的,所以不可能是这个。 然后我得到了这个:

  <binding name="WSHttpBinding_IFootprintService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:00:01" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
      <reliableSession ordered="true" inactivityTimeout="00:00:01" enabled="false" />
      <security mode="Message">
        <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
        <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
      </security>
    </binding>
    <binding name="AdministrationEndpoint" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:00:01" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
      <reliableSession ordered="true" inactivityTimeout="00:00:01" enabled="false" />
      <security mode="Message">
        <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
        <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
      </security>
    </binding>
    <binding name="ProductionEndpoint" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:00:01" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
      <reliableSession ordered="true" inactivityTimeout="00:00:01" enabled="false" />
      <security mode="Message">
        <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
        <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
      </security>


在这段代码中,我可以做很多不同的事情。我就是想不出closeTimeout、openTimeout、receiveTimeout、sendTimeout、inactivitytimeout和sessionstate timeout之间有什么区别?

借用@marc\s in的响应

最重要的是sendTimeout,它表示客户端需要多长时间 将等待WCF服务的响应。您可以指定 小时:分钟:秒在您的设置中-在我的示例中,我设置了 超时到25分钟

顾名思义,openTimeout就是您等待的时间量 当您打开与WCF服务的连接时,愿意等待。 类似地,closeTimeout是关闭服务器的时间量 连接(释放客户端代理),您将在 异常被抛出

接收超时有点像发送超时的镜像 sendTimeout是您等待来自的响应的时间量 服务器,receiveTimeout是您将给您的时间量 客户端接收并处理来自服务器的响应

如果您来回发送“正常”消息,两者都可以 非常短-尤其是收到SOAP后的接收超时时间 消息、解密、检查和反序列化几乎需要 没时间了。流媒体的故事是不同的-在这种情况下,你 在客户端上可能需要更多时间才能真正完成“下载” 从服务器返回的流的名称


希望有帮助,

希望这个网站对你有所帮助 关于超时的快速摘要:

在客户端:
SendTimeout–用于初始化OperationTimeout,它控制发送消息的整个过程,包括接收请求/回复服务操作的回复消息。当从回调协定方法发送回复消息时,此超时也适用

OpenTimeout–在未指定显式超时值的情况下打开通道时使用

CloseTimeout–在未指定显式超时值的情况下关闭通道时使用

ReceiveTimeout–不用于客户端超时

在服务端:
SendTimeout、OpentTimeout和CloseTimeout与客户端上的相同

ReceiveTimeout–由服务框架层用于初始化会话空闲超时,该超时控制会话在超时之前可以空闲多长时间


另请参阅这篇关于WCF会话超时的帖子

,这样没有一个会话超时会让用户自动注销?我知道是这样的:但一定是其他原因导致用户注销:/n因为这需要用户4小时注销?应该是不活动时间导致用户注销。用户注销需要1分钟以上的时间。如果触发sendtimeout,它可能会触发下一个超时,因此所有超时的附加超时就是用户注销所需的时间?不,我不认为它是这样工作的,请注意,所有超时都描述独立事件。