接受的方式,以prevent"远程主机关闭了连接"例外 [英] Accepted way to prevent "The remote host closed the connection" exception

查看:268
本文介绍了接受的方式,以prevent"远程主机关闭了连接"例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的不断的得到了以下异常是由用户启动一个下载造成的,因此它没有(或者被取消):

I'm constantly getting the following exception which is caused by a user initiating a download and it consequently failing (or being cancelled):

错误消息:关闭远程主机   连接。错误code是   0x80072746。堆栈跟踪:在   System.Web.Hosting.ISAPIWorkerRequestInProcForIIS6.FlushCore(字节[]   状态字节]头,的Int32   keepConnected,的Int32 totalBodySize,   INT32 numBodyFragments,IntPtr的[]   bodyFragments,的Int32 []   bodyFragmentLengths,的Int32   doneWithSession,的Int32 finalStatus,   布尔和放大器;异步)在   System.Web.Hosting.ISAPIWorkerRequest.FlushCachedResponse(布尔   isFinal)在   System.Web.Hosting.ISAPIWorkerRequest.FlushResponse(布尔   finalFlush)在

Error Message : The remote host closed the connection. The error code is 0x80072746. Stack Trace : at System.Web.Hosting.ISAPIWorkerRequestInProcForIIS6.FlushCore(Byte[] status, Byte[] header, Int32 keepConnected, Int32 totalBodySize, Int32 numBodyFragments, IntPtr[] bodyFragments, Int32[] bodyFragmentLengths, Int32 doneWithSession, Int32 finalStatus, Boolean& async) at System.Web.Hosting.ISAPIWorkerRequest.FlushCachedResponse(Boolean isFinal) at System.Web.Hosting.ISAPIWorkerRequest.FlushResponse(Boolean finalFlush) at

我已经搜查所有在互联网上,<一个href="http://blog.whitesites.com/fixing-The-remote-host-closed-the-connection-The-error-$c$c-is-0x80070057__633882307305519259_blog.htm">and发现一个有趣的文章,但似乎没有成为一个明确的答案,以prevent的最佳方式这填补了日志。

I've searched all over the internet, and found an interesting article, however there doesn't seem to be a definitive answer as the best way to prevent this filling up the logs.

用户看不到错误,因为它仅出现(我的理解)的情况下,其控制的(用户取消下载或连接的损失)有一个在应用程序没有实际的问题,但必须有一个方法来prevent这样的异常被报道。

The user sees no error and there's no actual problem in the app as it occurs only (to my understanding) in situations out of its control (user cancelling download or loss of connection) but there has to be a way to prevent such an exception being reported.

我讨厌这样说,但我很想来检查这个例外,空catch块的屁股了 - 不过这让我感觉像一个肮脏的程序员

I hate to say it but I'm tempted to check for this exception and empty catch block its ass away - but this makes me feel like a dirty programmer.

所以 - ?什么是preventing接受的方法,此异常填补了我的邮箱

推荐答案

您不能prevent远程主机关闭任何东西。

You cannot prevent a remote Host to close anything.

和一些协议,这是正常的(或至少接受)的方式说再见。

And in some protocols this is the normal (or at least accepted) way to say goodbye.

所以,你将不得不处理这个具体的例外。

So you will have to handle this specific exception.

这篇关于接受的方式,以prevent&QUOT;远程主机关闭了连接&QUOT;例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆