10053 您的主机中的软件中止了一个已建立的连接
场景 在不同的开发机器上,建立HTTP1.1连接,有的机器会进行一两次交互后,会检测到断开连接。这种情况下,会需要重连服务器。一般断开的原因包括硬件/路由/代理服务器。 目前尝试添加Keep-Alive字段,目前来看估计跟机器有关 摘自 You are assuming that the connection is staying open after each HTTP response is received,but that is not guaranteed. You have to look at the server's actual HTTP response (specifically,at the HTTP version reported in the status line,and at the Connection header) to know if the server is leaving the connection open or not. You are sending an HTTP 1.1 request,but there is no guarantee that the server will reply with an HTTP 1.1 response. If the response is using HTTP 0.9,you must close the socket and reconnect before sending the next HTTP request. If the response is using HTTP 1.0,and if the Connection header does not say keep-alive,then you must close the socket and reconnect before sending the next HTTP request. If the response is using HTTP 1.1,and if the Connection header does not say close,then the server left the connection open on its end,and you can reuse the same connection for the next request. However,you do still need to take into account the possibility that the connection might be closed externally (by a firewall/router/proxy,etc) before you actually send the next HTTP request. So in the case of either HTTP 1.0 or 1.1,if you are expecting the connection to remain open,but send () fails with an error indicating the connection was lost,simply close the socket and reconnect and then send the same HTTP request again. (编辑:百色站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- ms-office – Microsoft Office 2010功能区自定义UI中的Pha
- Windows系统·添加Python import 的库/模块路径
- JLink重刷固件(win7/win8/win10亲测可用)
- npm ERR!注册表错误解析json – 尝试在Windows 8中安装Cor
- 如何在Windows Phone 7系列上获取屏幕尺寸?
- Windows 下安装 Node.js
- 06、林信任快捷方式
- Windows Server 2016 新功能HCI(超融合基础架构) By S2D
- 在非Qt应用程序中使用基于Qt的DLL
- 在没有Microsoft.NET.Sdk.Web的情况下使用Razor
- winapi – Win32 No-MFC中的消息映射
- windows下部署Tomcat8
- windows修改PowerShell(命令提示符)默认中文编
- 如何正确使用MSBuild社区任务库在.NET dll上设置
- 类共享警告不允许我使用visualVM在本地(Windows)
- 值为NULL的列是否会影响Microsoft SQL Server的性
- windows – CreateWindowEx的lpClassName参数如何
- windows-ce – 确定Windows CE可执行文件使用的1
- window python2.7 ImportError: No module named
- windows – 启动进程时“print”和“printo”动词