Connection reset by peer原因分析
来源:互联网 发布:openwrt 修改mac 编辑:程序博客网 时间:2024/05/27 16:40
我用C语言写了一段程序,在客户端运行,去请求服务器端的文件。发现有时候会出现send命令发出去后,read得到的返回值为-1,errno值为Connection reset by peer的情况。
TCP机制中,socket连接的双方都可以调用close()之类的函数退出当前连接,TCP根据改进了的三次握手机制通知另一方也退出当前连接。这个过程可以看做是正常socket连接的一部分。
同时,TCP提供一种复位机制,在一方的程序遇到异常情况断开此次连接后,会向对方发送重置报文。复位是即时的退出,并清理此次连接相关的所有资源。
所以出现Connection reset by peer的原因是对端服务器异常退出了此次连接。
客户端遇到这种情况,只有重新和服务器端建立连接。我遇到的这种情况下,有时要重试5次左右才能够正常连接上。
- Connection reset by peer原因分析
- Connection reset by peer原因
- Connection reset by peer的原因
- Connection reset by peer的常见原因
- Connection reset by peer的常见原因
- Connection reset by peer的常见原因
- Connection reset by peer的常见原因
- Connection reset by peer的常见原因
- Connection reset by peer 的常见原因
- Connection reset by peer的原因
- Connection reset by peer的常见原因
- Connection reset by peer的常见原因
- Connection reset by peer的常见原因
- Connection reset by peer的常见原因
- Connection reset by peer的常见原因
- Connection reset by peer
- Connection reset by peer
- Connection reset by peer
- 通过alias命令设置快捷操作等
- 保存通话记录 二
- 利用远程桌面连接实现外网对局域网计算机的控制
- MySQL数据库优化总结
- 虚拟机里的“共享文件夹”
- Connection reset by peer原因分析
- pvr与png的内存占用
- Android常用的工具类-收藏用
- memcpy 原型
- Oracle10g修改安装 和 Oracle数据库卸载 和 Oracle服务项批处理命令 和 注意事项
- Struts2配置文件中package属性namespace能否省略的问题
- 利用异或求解 N^N=0 N^0=N
- 委托和事件
- Perl_匹配段落前略过的部分$`_匹配段落$&_匹配段落后的部分$'