> 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. 谈谈我的入门级实体框架Loogn.OrmLite

    每次看到有新的ORM的时候,我总会留意一下,因为自己也写过一个这样的框架,人总是有比较之心的.我可能会down下来跑一跑,也可能不会这么做,这个取决于跑起来的难易程度.我是很懒的,有XML配置或其他稍 ...

  2. 重新注册IIS

    出现问题的原因是先装了.NET4.0,再装IIS造成 处理方法:管理员权限执行cmd, C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_reg ...

  3. jsp中iframe填充装个页面

    首先要引入这个css,由于我之前没有引入这个,导致iframe的高度一只是默认高度,没有改变 <style type="text/css"> body, html { ...

  4. WIN10 CMD 启动虚拟WIFI

    1.以管理员身份运行命令提示符: 快捷键win+R→输入cmd→回车 2.启用并设定虚拟WiFi网卡: 运行命令:netsh wlan set hostednetwork mode=allow ssi ...

  5. Java开发面试总结

    Java开发面试总结.. ----------------------- java 基础知识点这一块: 1.面向对象的三大特征.(继承,封装,多态) 1.1 在什么样的场合下面会使用到继承 1.2 什 ...

  6. Git 学习笔记参考

    1.参考学习资料 网上资料: http://www.cnblogs.com/aoguren/p/4189086.html http://www.liaoxuefeng.com/wiki/0013739 ...

  7. SQL2005解密已经被加密的存储过程

    SQL2005解密已经被加密的存储过程 第一步:打开DAC连接功能 第二步:在MASTER数据库创建一个解密存储过程 USE master GO CREATE PROCEDURE [dbo].[sp_ ...

  8. 关于ajax的提交未完再续!

    $.ajax({ cache: true, type: "POST", url:"__URL__/add", data:$('#myform').seriali ...

  9. cf723d Lakes in Berland

    The map of Berland is a rectangle of the size n × m, which consists of cells of size 1 × 1. Each cel ...

  10. [Machine Learning & Algorithm] 随机森林(Random Forest)

    1 什么是随机森林? 作为新兴起的.高度灵活的一种机器学习算法,随机森林(Random Forest,简称RF)拥有广泛的应用前景,从市场营销到医疗保健保险,既可以用来做市场营销模拟的建模,统计客户来 ...