远程主机关闭了连接。错误code是80070057 [英] The remote host closed the connection. The error code is 0x80070057

查看:516
本文介绍了远程主机关闭了连接。错误code是80070057的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到了很多我的日志这些错误消息对我的一个服务器间歇两个人。

I'm getting a lot of these error messages in my logs on one of my servers and intermittently on two others.

谷歌搜索并没有透露很多信息,大多是文件被打断上传或下载有关。

Googling didn't reveal very much information, mostly related to file uploads or downloads being interrupted.

我的页面基本上只是文字在他们确定的文件,只有对未来的计划.aspx扩展名,没有实际的code中的页面供电。服务器运行IIS7 / ASP.NET 4所有Windows Server 2008 RC2 64。

My pages are basically just text files with "ok" in them that only have .aspx extension for future plans, there's no actual code powering the pages. Servers are all Windows Server 2008 RC2 x64 running IIS7 / ASP.NET 4.

统计学它下的时间的1%发生良好,但由于交通量的仍然杂波我的事件日志与2或每分钟这些消息中的3

Statistically it's happening well under 1% of the time but because of the volume of traffic that still clutters my event log with 2 or 3 of these messages per minute.

编辑:
我找到了问题所在,设置缓冲,以真正停止了它的发生。

I tracked down the problem, setting buffering to true stopped it occurring.

推荐答案

我知道这已经回答了,但在关闭的机会,这可以帮助别人,它在我的MVC项目发生有时当我有一个的DbContext设置在顶部的存储库。当我切换到使用语句的数据库连接,错误永远不会又出现了。

I know this has been answered, but on the off chance this helps someone else, it happened in my MVC project sometimes when I had one dbContext set at the top of a repository. When I switched to a using statement for database connections, the error never appeared again.

所以,我从这个去在每个仓库的顶部:

So, I went from this at the top of each repository:

DbContext db = new DbContext();

要这样为每个连接:

using (DbContext db = new DbContext())
{
     //db connection stuff here....
}

值得一说的没有人报告说看到错误,并没有错误是以往任何时候显示的浏览器,但是很高兴得到它的日志都一样!

Worth saying that no one ever reported seeing the error and no error was ever shown to the browser, but nice to get it off the logs all the same!

这篇关于远程主机关闭了连接。错误code是80070057的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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