WCF超时问题?
我有一个有点长采取基于WCF的过程。 WCF服务,如果有任何帮助它运行在Azure上。我相信这个问题有超时的事:
I have a somewhat long-taking WCF-based process. WCF service runs in Azure if its of any help. The issue I believe has to do with timeouts:
1)的WinForms客户端在绑定节以下的.config设置:
1) Winforms client has the following .config setting in the binding section:
<wsHttpBinding>
<binding name="XXX" closeTimeout="00:05:00" openTimeout="00:05:00"
receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false"
transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="10000000" maxReceivedMessageSize="10000000"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="255" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="false"/>
</security>
</binding>
</wsHttpBinding>
2)WCF服务具有以下绑定区段在web.config
2) WCF service has the following binding section in the web.config
<wsHttpBinding>
<binding name="XXX" maxReceivedMessageSize="10000000" sendTimeout="00:10:00" receiveTimeout="00:10:00" closeTimeout="00:10:00" openTimeout="00:10:00">
<security mode="TransportWithMessageCredential">
<message clientCredentialType="UserName" establishSecurityContext="false" />
</security>
<readerQuotas maxArrayLength="2000000" maxBytesPerRead="10000000" maxStringContentLength="10000000" maxDepth="255" />
</binding>
</wsHttpBinding>
3)我在WCF(一般为2分钟)一个长运行的方法。客户端调用该方法,和那些执行较长再用1分种越来越抛出带有异常。这是最内部异常:
3) I have one long-running method in WCF (generally 2 minutes). Clients call the method, and those that execute for longer then 1 minute are getting thrown out with an exception. This is the most inner exception:
<InnerException>
<Type>System.Net.Sockets.SocketException</Type>
<Message>An existing connection was forcibly closed by the remote host</Message>
<StackTrace>
<Frame>at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)</Frame>
</StackTrace>
</InnerException>
</InnerException>
4)WCF调用自身成功完成,但(我都开始/结束登录服务器端)。如何避免异常?
4) The WCF call itself completed successfully, however (I have both Start/End logged on server side). How do I avoid the exception?
感谢您!
在Windows Azure负载平衡器60秒后终止空闲连接。
The Windows Azure load balancer terminates idle connections after 60 seconds.