2014-01-09 28 views
0

我在一个非常大的项目上做了一些支持。我的任务是将会话超时更改为更长的时间,然后是现在的时间。现在他们在大约10分钟左右就被注销了。我发现了很多不同的事情,我需要一些帮助来搞清楚他们所做的一切。会话超时差异

首先,我得到了这一个:

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

这是后240分钟triggerd所以它不可能是这一个。 然后我得到这个:

<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超时之间的区别是什么?

回答

1

借款@marc_s响应在this question

最重要的是的SendTimeout,它说多久客户 将等待您的WCF服务的响应。您可以在设置中指定 小时:分钟:秒 - 在我的示例中,我将 超时设置为25分钟。

openTimeout顾名思义,当您打开连接到WCF服务时,您愿意等待的时间量为 。 同样,closeTimeout是关闭 连接(处理客户端代理)时您要等待 异常抛出之前的时间。

receiveTimeout有点像为的SendTimeout镜子 - 而 的的SendTimeout是时间,你会等待 服务器的响应量,receiveTimeout是量你会给你 客户端来接收和处理来自服务器的响应。

如果你来回发送“正常”的消息,既可以 很短 - 尤其是receiveTimeout,因为接收SOAP消息 ,解密,检查和反序列化应采取几乎 没有时间。这个故事与流媒体不同 - 在这种情况下,您可能需要更多时间在客户端上实际完成从服务器获取的流的“下载” 。

希望它能帮助,

+0

所以非他们的,使用户自动关闭LOGG? 我知道这样做: 但它得到了其他东西,使用户登录:/因为这需要用户4小时注销? –

+0

它应该是使用户注销的不活动时间。 – avenet

+0

用户登录需要1分多钟。也许如果sendtimeout被触发,它会触发下一个超时,以便所有超时的添加超时是用户注销所需的时间? –

1

希望这个网站可以帮助你了解超时有点http://msdn.microsoft.com/en-us/library/hh924831(v=vs.110).aspx 快速摘要:

在客户端:
的SendTimeout - 用来初始化OperationTimeout,它支配着整个发送消息的过程,包括接收请求/应答服务操作的应答消息。从回调合同方法发送回复消息时,此超时也适用。

OpenTimeout - 使用未指定明确的超时值时,打开通道时

CloseTimeout - 使用时没有指定明确的超时值

ReceiveTimeout关闭通道时 - 不使用客户端超时

服务端:
SendTimeout,OpentTimeout,CloseTimeout与客户端上的相同

ReceiveTi meout - 服务框架层用来初始化会话空闲超时,它控制会话在超时之前可以空闲多久。

也看到这个帖子有关WCF会话超时WCF Session Timeout