Socket程序中的Error#10054错误
近期使用winSock做的一个网络项目中,使用TCP+Socket连接编写的一个多线程的网络程序,功能是client负责不断地向server端发送数据,服务端负责接收数据。client是一个DLL,服务端程序是一个随机启动的NT Service服务程序。
程序在夜间无人操作的执行过程中,client常常不定时地出现错误号为:10054的错误,而server端并没有对应的提示。执行环境是win2000+sp4,这个问题出现得比較莫名其妙。
查了MSDN上的10054错误号说明:WSAECONNRESET (10054)
Connection reset by peer.
A existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, or the remote host used a "hard close" (see setsockopt for more information on the SO_LINGER option on the remote socket.)
也就是说,一个连接被对方重设。一个建立的连接被远程主机强行关闭,若远程主机上的进程异常终止执行(因为内存冲突或硬件故障),或者针对套接字执行了一次强行关闭,便会产生10054错误。针对强行关闭的情况,可用SO_LINGER套接字选项和setsockopt来配置一个套接字。
最新文章
- css3clock.js - 一个用CSS3与纯js实现的简单时钟
- jQuery实现瀑布流
- Neo4j Index Notes
- iOS 基于UIWebView的应用特点
- Android 使用AIDL调用外部服务
- JQuery(三) Ajax相关
- 深入理解Python中的生成器
- JSP中 JSTL
- linux跨主机复制文件或文件夹
- 【转载】 ISO14229系列之二:诊断指令格式和相关概念
- Linux上查看用户名和组并把特定用户放到特定的组之下
- Tomcat设置cmd窗口的title属性
- Linux中断管理
- 使用163.com邮箱发送邮件
- PythonStudy——赋值运算符 Assignment operator
- Inno Setup使用
- Docker源码分析(八):Docker Container网络(下)
- c# MVC模式学习笔记_数据验证
- 【week10】规格说明书练习-吉林市1日游
- mysql root用户密码个性
热门文章
- C语言小结之链表
- WebForm中TreeView的使用
- JVM 学习笔记(二)
- Hibernate save或者persist 后获取主键ID
- VS2005 检测内存泄漏的方法(转载)
- InvalidIndexNameException[Invalid index name [2Shard], must be lowercase]
- [cocos2d]cocos2d 2.1与ios 6.0
- unicode转中文
- wcf异常汇总
- Learing WCF Chapter1 WCF Services