?
Solved

When to use TIdAntiFreeze?

Posted on 2006-07-07
2
Medium Priority
?
3,023 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:2266180
ID: 17057054
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 375 total points
ID: 17067061
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

757 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