Connection Reset By Peer 解析
来源:互联网 发布:php前景 知乎 编辑:程序博客网 时间:2024/04/28 21:40
linux网络编程 Connection reset by peer错误
服务器向客户端发送了数据,客户端没有接收就关闭了,服务器read就会发生Connection reset by peer错误。
我试验了一下,确是如此。
同学们遇到过这个问题吗?
------解决方案--------------------------------------------------------
客户端调用close()时,服务器应该会读到一个EOF,read()返回0
------解决方案--------------------------------------------------------
Connection reset by peer 本质是收到一个标记了reset位的数据包。
这个错误的原因有几种:
1. connect到一个不存在的端口。
2. 对方故意发送RST包(一些网络破坏程序会这么干)。
3. 对方故障(中途掉线,程序重启)等原因,导致socket失效,或者不再是原来那个socket。(你遇到的应该就是这种)
------解决方案--------------------------------------------------------
服务器向客户端发送了数据,客户端没有接收就关闭了,服务器read就会发生Connection reset by peer错误。
我试验了一下,确是如此。
同学们遇到过这个问题吗?
------解决方案--------------------------------------------------------
客户端调用close()时,服务器应该会读到一个EOF,read()返回0
------解决方案--------------------------------------------------------
Connection reset by peer 本质是收到一个标记了reset位的数据包。
这个错误的原因有几种:
1. connect到一个不存在的端口。
2. 对方故意发送RST包(一些网络破坏程序会这么干)。
3. 对方故障(中途掉线,程序重启)等原因,导致socket失效,或者不再是原来那个socket。(你遇到的应该就是这种)
------解决方案--------------------------------------------------------
TCP协议中有RST标志位, 不管原因是什么, 正确的判断返回值-1, errno != EINTR && errno != EAGAIN就可以认定对端出错, 立即cloes即可.
from:http://hi.baidu.com/chemical_liang/item/7f84c9213a95d19ab7326316
0 0
- Connection Reset By Peer 解析
- Connection reset by peer
- Connection reset by peer
- Connection reset by peer
- Connection reset by peer
- putty "connection reset by peer"
- ERROR:Connection reset by peer
- 再探Connection Reset By Peer
- SocketException: Connection Reset by peer
- Connection reset by peer原因
- Connection reset by peer的原因
- Connection reset by peer , socket write error
- 关于[10054] Connection reset by peer 错误
- Connection reset by peer: socket write error
- Connection reset by peer: socket write error
- Connection reset by peer: socket write error
- Hadoop master connection reset by peer resolution
- ZBX_TCP_READ() failed [Connection reset by peer]
- boost.asio的跨平台实现 <转>
- VC++添加菜单栏
- HDU 1253 胜利大逃亡
- linux常用命令详解
- Java 调用 C/C++ 之 JNA 系列实战篇 —— 输入wchar_t* (二)
- Connection Reset By Peer 解析
- 文件下载servlet
- log file sync(日志文件同步) 与 Log file parallel write 等待事件
- js 实现60秒倒计时
- POJ 3461 Oulipo
- toolchain download
- 随机抽样问题(蓄水池问题Reservoir Sampling)
- HsqlDB源码学习——BaseHashMap的实现
- MFC学习之 在按钮上加图标与文字共同显示