Solved

When to use TIdAntiFreeze?

Posted on 2006-07-07
2
2,740 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 125 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Create Database on Android via Delphi dbExpress 3 112
how to send memory stream from ics Client To ics server ? 11 136
Base1 Encode/Decode 3 81
Dev express lookupcombo 3 35
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

860 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