2011-02-01 11 views
5

私は多少時間がかかるWCFベースのプロセスを持っています。 WCFサービスはAzureで動作します。WCFタイムアウトの問題?

<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ファイルで以下の結合部分があります。

1)のWinFormsクライアントは結合セクションで、次の.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で長時間実行する方法は1つ(通常は2分)です。クライアントはメソッドを呼び出し、1分以上実行したものは例外を出して投げ捨てられます。これは、最も内側の例外です:

<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が正常に完了し自分自身を呼び出して、しかし(私が持ってスタート/エンドの両方)は、サーバー側で記録されます。例外を避けるにはどうしたらいいですか?

ありがとうございました!

+0

いつでも、それを実行する分を引き継ぎ、そのエラーを返します。エラーは1分後に正確にクライアントに返されます。ただし、サーバーはまだメソッド呼び出しを終了しています。 – Igorek

答えて

8

のWindows Azureのロードバランサは、60秒後にアイドル状態の接続を終了します。

+1

スティーブ、うわー、まったくこれを知らなかった...とにかくタイムアウトを延長するためにそこにいますか?一部の通話は完了するまでに1分以上かかる場合があります。 – Igorek

+0

興味深い。 Steveはこの動作を変更する方法がありますか、またはキューやその他のクロスタスクメソッドを使用して長時間実行されるジョブをワーカーロールに配置する意図はありますか? –

+0

これを変更する方法は現在ありません。ただし、TCP接続を介して定期的にデータを送信できる場合は、開いたままになります。 (接続が終了するのは_idle_接続のみです) – smarx

関連する問題