> Should I use a AntiFreeze component on every form I have a TIdTCPClient 
> component?  Or is one enough to handle the whole Application?

One is enough. According to the Indy help file,

-------- 
Only one TIdAntiFreeze can be active in an application. If another 
instance already exists, an exception is raised. 
--------

Note that if you have multiple TIdTCPClient objects connected at the 
same time, and you call ReadXXX twice or more often (e. g. on a button 
click event) in the main thread context, then the last called ReadXXX 
will return first, blocking the other ReadXXX requests even if they 
could return data. This is because of the nature of the AntiFreeze 
mechanism.

To avoid this effect, use a dedicated reader thread for each connection 
instead of AntiFreeze. There is a TIdTCPClient descendant with its own 
reader thread, firing an event when data arrive, at 
http://come.to/delphi-bits .

-Michael

TIdAntiFreeze
Prevents an application UI from freezing.
TIdAntiFreeze = class(TIdAntiFreezeBase)
Unit
Description
Indy works on the blocking model. That is when calls are made to Indy the do not return until they are complete. If calls are made in the main thread this will cause the Application User Interface to "freeze" during Indy calls. TIdAntiFreeze counter acts this effect. TIdAntiFreeze allows Indy subsystem to make process Application message calls so that Windows messages continue to be executed while Indy blocking socket calls are in effect.

Only one TIdAntiFreeze can be active in an application. If another instance already exists, an exception is raised. TIdAntiFreezeBase uses the global variable GAntiFreeze, declared in the TIdAntiFreezeBase unit, to determine if another instance has already been created.

Note: GAntiFreeze is not assigned if an instance is added in the form designer (during design time).

Note: The TIdAntiFreeze.pas unit must NOT appear in the uses clause of any Indy or descendant unit. This unit is linked in an application when the component is placed on a Form. This is done to preserve isolation from the Forms.pas and QForms.pas units.


TIdAntiFreeze.Process
Implements TIdAntifreeze functionality.
procedure Process; override;
Description
Process is the overridden implementation of the abstract virtual TIdAntiFreezeBase.Process method. Process inspects the ApplicationHasPriority property to determine if Application.ProcessMessages is called. If False, the pending Windows message is dispatched to Application.HandleMessage.

Note: Due to the differences in message dispatching, Process does not use or inspect ApplicationHasPriority on the Linux Platform; Process simply calls Application.ProcessMessages.

Note: The TIdAntiFreeze.pas unit must NOT appear in the uses clause of any Indy or descendant unit. This unit is linked in an application when the component is placed on a Form. This is done to preserve isolation from the FORMS.PAS and QForms.pas units.

Indy FTP 警告:Only one TIdAntiFreeze can be active in an application的更多相关文章

  1. ftp 229

    在sels10机器上登入ftp输入用户名和密码之后再ls发现出现如下问题Entering Extended Passive Mode ftp> ls229 Entering Extended P ...

  2. Different between Telnet/SSH/FTP

    http://www.differencebetween.net/category/technology/protocols-formats/ Telnet vs SSH Secure Shell, ...

  3. ftp的主动模式active mode和被动模式 passive mode的配置和区别

    ftp的主动模式active mode和被动模式 passive mode的配置和区别 2017年05月08日 17:47:16 阅读数:21768 本文主要记录的是在linux上的区别,弄了一整天才 ...

  4. iOS警告框和操作表

    应用如何与用户交流呢? 警告框(AlertView)和操作表(ActionSheet)就是为此而设计的. 本文案例的原型草图如图3-48所示,其中有两个按钮“Test警告框”和“Test操作表”,点击 ...

  5. IdTcpClient简单示例

    procedure TForm1.btnHttpGetClick(Sender: TObject); begin idtcpclnt1.Host := '192.168.10.88'; idtcpcl ...

  6. Codeigniter

    最近准备接手改进一个别人用Codeigniter写的项目,虽然之前也有用过CI,但是是完全按着自己的意思写的,没按CI的一些套路.用在公众的项目,最好还是按框架规范来,所以还是总结一下,免得以后别人再 ...

  7. 总结Codeigniter的一些优秀特性

    总结Codeigniter的一些优秀特性 近期准备接手改进一个别人用Codeigniter写的项目.尽管之前也实用过CI,可是是全然按着自己的意思写的,没按CI的一些套路.用在公众的项目,不妨按框架规 ...

  8. Codeigniter的一些优秀实践

    最近准备接手改进一个别人用Codeigniter写的项目,虽然之前也有用过CI,但是是完全按着自己的意思写的,没按CI的一些套路.用在公众的项目,最好还是按框架规范来,所以还是总结一下,免得以后别人再 ...

  9. 转:Delphi 6 实用函数

    来自: daocaoren0824, 时间: -- ::, ID: 再给你一份 程序员实用函数 {▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎} {▎ ▎} {▎ 大 ...

随机推荐

  1. C#软件设计——小话设计模式原则之:依赖倒置原则DIP

    前言:很久之前就想动笔总结下关于软件设计的一些原则,或者说是设计模式的一些原则,奈何被各种bootstrap组件所吸引,一直抽不开身.群里面有朋友问博主是否改行做前端了,呵呵,其实博主是想做“全战”, ...

  2. 读书笔记---《火球:UML大战需求分析》

    书评 作为一本UML和需求分析的入门书来说还算可以,写的比较接地气,如果是做过很多项目的读者,很容易找到共鸣点. 美中不足:部分概念可能有错误,其中对于Component和Artifact的解释明显和 ...

  3. lvs/dr配置

    lvs/dr Director server : DIP:192.168.1.100/24  eth0 VIP:192.168.1.101/24  eth0:0 Real server: Real1: ...

  4. Java部署_IntelliJ创建一个可运行的jar包(实践)

    一.本文目的:使用Intellij Idea 13生成一个简单可执行的jar,用于快速在linux验证某个功能 二.项目源码 1.结构图  2.StaticC1.java 1 2 3 4 5 6 7 ...

  5. 看jpg和png图片

    emacs 24.4 下载http://pan.baidu.com/s/1mgIEPHe里的: zlib1.dll, libpng16-16.dll(png)和libjpeg-9.dll到emacs里 ...

  6. UEditor独立图片、文件上传模块

    百度的UEditor编辑器的强大之处不用多说,但是有时候我们只想用他的文件.图片上传模块,不想把这个编辑器加载出来,话不多说,直接上实现代码: 引用文件: <script src="~ ...

  7. php以pdo方式连接sqlserver,无法开启sqlsrv扩展

    首先,PHP连接sqlserver代码如下: $host="aaaaa"; $dbname="aaaaa"; $user="aaaaa"; ...

  8. 深度分析mysql GROUP BY 与 ORDER BY

    鉴于项目的需要,就从网上找到该文章,文章分析得很详细也很易懂,在android里,(不知道是不是现在水平的限制,总之我还没找到在用ContentProvider时可以使用子查询),主要方法是用SQLi ...

  9. 在Excel中使用SQL语句查询和筛选

    本文转自:http://blog.sina.com.cn/s/blog_5fc375650102e1g5.html 今天在微博上看到@数据分析精选 分享的一篇文章,是关于<在Excel中使用SQ ...

  10. NodeJs框架

    Node.js非常适用于Web开发,但是现在无论是一个网站,还是Web App都已经成为包括很多不同部分,如前端.数据库.业务模块.功能模块等等的大型项目,使用Node.js从零开始进行Web开发,也 ...