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. (编辑:莱芜站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- 应用程序无法正常启动0xc000007b解决方法
- WIN10下安装 NGINX+PHP+MYSQL(WNMP) 环境
- 替代Windows的Fsync c
- silent-installer – 如何在没有用户交互的情况下安装Micro
- xaml – 在开发Windows 8 Store应用程序时处理不同的方向
- 何处下载适用于.NET 4.5的Microsoft Expression Blend软件开
- Windows系统DOS命令之多线程技术
- .net – SendKeys.Send和Windows Key
- Windows Phone 8.1 cordova下拉列表无法正常工作
- 如何将windows自带的简化版OneNote卸载?
- windows – 如何使用Win32 API获取多个监视器的显
- windows – 当磁盘上的文件发生更改时,Emacs挂起
- macos – 在Windows上使用Tycho构建的Eclipse RC
- xaml – 如何将我的视图模型中的富文本(FlowDocu
- 如何在Windows PowerShell中进行屏幕截图?
- 如何在Window中的嵌入式浏览器中调试Javascript?
- Microsoft Windows远程桌面协议中间人攻击漏洞(C
- windows-vista – 使用托管代码调用死亡蓝屏
- 2018-5-26 怎么在windows上远程连接linux服务器上
- 如何在Windows上制作相同高度的SWT按钮,文本和标