Solved

When to use TIdAntiFreeze?

Posted on 2006-07-07
2
2,625 Views
Last Modified: 2010-05-18
Hi!

I am using Indy 9 in a client tcp application, and my question is following:

Is it ok to put a while loop in a buttonclick event and then use a TIdAntiFreeze or should i start a thread in
the event instead?
And how mutch will TIdAntiFreeze slow down the communication?  
0
Comment
Question by:mikrodidakt
2 Comments
 
LVL 28

Expert Comment

by:ciuly
Comment Utility
the TIdAntiFreeze should be placed on the form and configured according to your needs. you don't have to create it dynamically. it will just make sure that you user interface will not freeze during operations.
0
 
LVL 17

Accepted Solution

by:
TheRealLoki earned 125 total points
Comment Utility
if you are using an Indy client outside of a thread (out side a thread is the default way) and it does some time consuming things, such as copying a large stream of data, then that is when you drop a TIdAntiFreeze on the form.
The downside is that if you have buttons on the form, the user will then be able to click on them.
So if you want the user to be able to press a "download file" button, you will have to remember to disable the button until the download completes, so they do not try to download again while it is still downloading...

TIdAntiFreeze itself will not slow down the communication, but any other button/process your user is then able to kick off... might.
If they do nothing but watch the pretty progress bars, you'll not lose much speed..
If the rest of your code plays nicely and does not hog the processer, you'll be fine.

I tend to go for the thread approach, but that's only because the vast majority of my indy projects are non-interactive, and I like to keep them separate
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video discusses moving either the default database or any database to a new volume.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now