?
Solved

When to use TIdAntiFreeze?

Posted on 2006-07-07
2
Medium Priority
?
2,885 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 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month10 days, 11 hours left to enroll

765 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