Solved

When to use TIdAntiFreeze?

Posted on 2006-07-07
2
2,768 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
can't find the executable in Simulator 1 112
Tembedded WB animatid gifs not animated on some pcs 2 86
Dev express lookupcombo 3 46
enhance the following code 3 42
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 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