0

イベントソースを介してJSクライアントと通信する.NETアプリケーションを開発しています。

それはかなりうまく機能しますが、私には問題があります:

サーバーの書き込み中にクライアントが切断されると、サーバーは10秒間スタックし続け、最後にエラーが発生します。

The remote host closed the connection. The error code is 0x80070079.

このエラーは正常であり、私はそれをキャッチしますが、10秒を回避するか、少なくとも1秒または2秒に制限したいと思います。

私のコードは次のようなものです:

 if (ctx.Response.IsClientConnected)
 {
      ctx.Response.Write("data: " + e.json + "\n\n");
 }

試してみまし<httpRuntime executionTimeout="3"/>たが、うまくいきません...

何か案が?

バレンティン:)

4

1 に答える 1

0

I think there might be a need for a minimum timeout based on connections' unreliability.

I don't know your code logic and architecture exactly but you can convert your operations to work asynchronously.

于 2013-01-02T20:10:57.833 に答える