在我的项目中,我使用elmah -> Elmah.axd查找错误。
有一个类似的错误:
System.Web.HttpException: The remote host closed the connection. The error code is 0x800703E3.
Generated: Sun, 27 Nov 2011 13:06:13 GMT
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Web.HttpException (0x800703E3): The remote host closed the connection. The error code is 0x800703E3.
at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)
at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()
at System.Web.HttpResponse.Flush(Boolean finalFlush)
at System.Web.HttpWriter.TransmitFile(String filename, Int64 offset, Int64 size, Boolean isImpersonating, Boolean supportsLongTransmitFile)
at System.Web.HttpResponse.TransmitFile(String filename, Int64 offset, Int64 length)
at SalarSoft.Utility.SP1.ResumeDownload.ProcessDownload(String fileName, String headerFileName)
at NiceFileExplorer.en.Download.DownloadFile_SalarSoft(String fileName)
at NiceFileExplorer.en.Download.GoForDownloadFile(String filepath)
at NiceFileExplorer.en.Download.MainCodes()
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
在使用网站的过程中,我们没有看到这个错误。
但是艾尔玛给我发了很多次错误。
这个错误意味着什么,我如何修复它?
编辑1
{我的网站是用于下载移动文件的,有时真的很忙)
{我正在使用windows server 2008 r2->远程访问}
评论后的编辑2
今天的一些窗口信息和警告(没有错误)日志如下所示:
警告
在关闭期间,为应用程序池“ASP.NET 4.0 (集成)”提供服务的进程超过了时间限制。进程id为'6764‘。
警告
工作进程'3232‘服务应用程序池'ASP.NET 4.0 (集成)’未能在分配的时间内停止协议'http‘的侦听器通道。数据字段包含错误号。
警告
在关闭期间,为应用程序池“ASP.NET 4.0 (集成)”提供服务的进程超过了时间限制。过程id为'3928‘。
发布于 2011-11-27 16:35:18
我在我创建的一个网站的日志中看到了很多这样的东西。
AFAIK这个异常意味着客户端在页面完成加载之前断开了连接(转到另一个页面/关闭了浏览器)。如果客户端正在下载文件,则更有可能出现此错误,因为他们有更多的时间决定退出/继续。
这个错误对用户是不可见的,所以我刚刚从Elmah日志中删除了它。
*该网站只允许经认证的用户。我从Elmah那里可以看出,他经历了这个错误,而且是什么时候。我问过用户,没有一个人报告过在客户端发生过这种错误。
发布于 2018-01-02 12:32:45
当用户取消文件下载时,我发现了这个错误。在服务器端,它生成一个异常,远程主机关闭了连接。错误代码为0x800703E3。但是,异常没有可以单独处理的任何不同类型。
在odrer中,为了正确地在ASP.NET MVC中处理它,我添加了一个异常记录器:
public static class RegisterFilters
{
public static void Execute(HttpConfiguration configuration)
{
configuration.Services.Add(typeof(IExceptionLogger), new WebExceptionLogger());
}
}
和WebExceptionLogger类实现:
public class WebExceptionLogger : ExceptionLogger
{
private const int RequestCancelledByUserExceptionCode = -2147023901;
public override void Log(ExceptionLoggerContext context)
{
var dependencyScope = context.Request.GetDependencyScope();
var loggerFactory = dependencyScope.GetService(typeof(ILoggerFactory)) as ILoggerFactory;
if (loggerFactory == null)
{
throw new IoCResolutionException<ILoggerFactory>();
}
var logger = loggerFactory.GetTechnicalLogger<WebExceptionLogger>();
if (context.Exception.HResult == RequestCancelledByUserExceptionCode)
{
logger.Info($"Request to url {context.Request.RequestUri} was cancelled by user.");
}
else
{
logger.Error("An unhandled exception has occured", context.Exception);
}
}
}
我注意到这个特定的错误类型有HResult = -2147023901,所以这就是我要过滤的内容。
希望这能有所帮助。
发布于 2013-11-15 01:57:58
我今天遇到了这样的情况,对我来说,这是因为套接字超时等待远程发送。
在本例中,异常(或故意)缓慢的客户端可能导致异常。
我选择通过增加套接字上的接收超时来解决这个问题,因为我想支持一些特定的较慢的客户端,这些客户端需要使用较高的SSL要求。
https://stackoverflow.com/questions/8286037
复制相似问题