idhttp post 出现exception class EIdSocketError with message 'Socket Error # 10054的解决办法(捕捉异常,防止程序挂掉)
由于项目需要。需要向一个地址提交数据。提交的次数很频繁,但是程序经常raised exception class EIdSocketError with message 'Socket Error # 10054
Connection reset by peer.' 造成程序异常,停止工作。
于是找到以下解决办法。Exception捕获不到该异常。需要用EIdException来捕获异常。
IDE环境: Delphi XE3 Version 17.0.4625.53395
INDY :IDE自带。
- v_sparm :TStringList;
- begin
- Result:='0';
- v_sparm := TStringList.Create;
- ……
- Form1.idhtp1.ConnectTimeout := 15000;
- Form1.idhtp1.ReadTimeout:=15000;
- ……
- try
- ……
- try
- Result:=Form1.idhtp1.Post(URL,v_sparm);
- except
- on e: EIdException do //用EIdException捕获Socket Error # 10054 Connection reset by peer
- begin
- WriteLog(e.Message); //处理异常信息。防止程序挂掉。
- end;
- end;
- finally
- end;
- end;
http://blog.csdn.net/rznice/article/details/8512321
idhttp post 出现exception class EIdSocketError with message 'Socket Error # 10054的解决办法(捕捉异常,防止程序挂掉)的更多相关文章
- spring mvc 框架启动报错:nested exception is java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal 解决办法
今天准备将以前自己搭建的一个框架拿出来用一下,结果发现启动报错:nested exception is java.lang.NoClassDefFoundError: org/w3c/dom/Elem ...
- tomcat日志报Invalid message received with signature的解决办法
这位大神说的是正解,大家可以参考一下这个链接:https://blog.csdn.net/bugdongwenlong/article/details/84261424
- 报错:Sqoop2 Exception: java.lang.NoSuchMethodError Message: org.apache.hadoop.security.authentication.client.Authenticator
报错过程: 进入sqoop2之后, 输入命令:show connector,报错 报错现象: Exception has occurred during processing command Exce ...
- jenkins编辑报错Exception when publishing, exception message的解决办法
jenkins编辑报错Exception when publishing, exception message的解决办法 查看目标主机的磁盘空间是否占满,清理磁盘空间即可
- CAS (10) —— JBoss EAP 6.4下部署CAS时出现错误exception.message=Error decoding flow execution的解决办法
CAS (10) -- JBoss EAP 6.4下部署CAS时出现错误exception.message=Error decoding flow execution的解决办法 jboss版本: jb ...
- Lumia 刷机(强刷)Message send failed解决办法
强刷可以救砖,不需要验证地区code,可以跨刷其它国家/地区的固件,但不是所有机型都可以这样,Lumia 620是支持跨刷的. 看本文你首先要知道使用Nokia Care Suite强刷的步骤,参考从 ...
- Message: unknown error: Element is not clickable at point
Message: unknown error: Element is not clickable at point google chrome - Debugging "Element is ...
- 遇到的Exception/error及解决办法记录汇总
一.java.net.SocketException 1.java.net.SocketException:Connection reset 首先,如果一端的Socket被关闭(或主动关闭,或因为异常 ...
- nova instance出错:"message": "Proxy error: 502 Read from server failed
执行 $ nova resize instance1 时候出错: {, "details": " File \"/opt/stack/nova/nova/com ...
随机推荐
- (转)ORA-01940: cannot drop a user that is currently connected 问题解析
删除数据库用户的时候经常会遇到这样的错误: ORA: cannot drop a user that is currently connected 原因是有程序在连接我们需要删除的用户,我们删除用户之 ...
- EularProject 41:最长的n位Pandigital素数问题
Pandigital prime Problem 41 We shall say that an n-digit number is pandigital if it makes use of all ...
- 【重拾Effective Java】一
之前看这本<Effective Java(第二版)>都是非常早曾经了.这本书确实是本好书.须要细嚼慢咽,每次看都有不同的体验. 在此写博客巩固一下. 第一章.创建和销毁对象 考虑用静态工厂 ...
- 用bootstrap做一个背景可轮转的登录界面
用bootstrap做一个背景可轮转的登录界面 一.总结 一句话总结:用css3的动画的 @keyframes 规则,制作轮转图. 1.用bootstrap做一个背景可轮转的登录界面? a.动画部分用 ...
- gdbserver远程调试嵌入式linux应用程序方法
此处所讲的是基于gdb和gdbsever的远程调试方法.环境为:PC机:win7.虚拟机:10.04.下位机:飞嵌TE2440开发板. 嵌入式linux应用程序的开发一般都是在linux里面编写好代码 ...
- TreeView控件的展开与折叠
在窗体中添加一个TreeView控件,设置CheckBox属性为True,绑定数据 Archive jkj = new Archive();//自定义类 public void Bind ...
- ZOJ 1108 FatMouse's Speed (HDU 1160) DP
传送门: ZOJ:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=108 HDU :http://acm.hdu.edu.cn/s ...
- [D3] Create Labels from Non-numeric Data with Ordinal Scales in D3 v4
When your data contains discrete, non-numeric property values that you need to format or convert bef ...
- 【solr专题之一】Solr快速入门 分类: H4_SOLR/LUCENCE 2014-07-02 14:59 2403人阅读 评论(0) 收藏
一.Solr学习相关资料 1.官方材料 (1)快速入门:http://lucene.apache.org/solr/4_9_0/tutorial.html,以自带的example项目快速介绍发Solr ...
- iconv简介(1、字符串|文件字符转换:iconv用于将一种已知的字符集文件转换成另一种已知的字符集文件)(2、编程语言函数功能的相似性:iconv不仅再php中有用,而且c语言中也有用,还有linux等)
iconv简介(1.字符串|文件字符转换:iconv用于将一种已知的字符集文件转换成另一种已知的字符集文件)(2.编程语言函数功能的相似性:iconv不仅再php中有用,而且c语言中也有用,还有lin ...