Indy FTP warning: Only one tidantifreeze can is active in an application

Source: Internet
Author: User
<span id="Label3"></p><p><p>> Should I use a antifreeze component on every form I had a tidtcpclient<br>> component? Or is one enough to handle the whole application?</p></p><p><p></p></p><p><p></p></p><p><p>One is Enough. According to the Indy help file,</p></p><p><p>--------<br><strong>Only one tidantifreeze can is active in an Application. If another</strong><br><strong>Instance already exists, an exception is Raised.</strong><br>--------</p></p><p><p>Note If you have multiple Tidtcpclient objects connected at the<br>Same time, and you call readxxx twice or more often (e. g. on a button<br>Click Event) in the main thread context, then the last called Readxxx<br>Would return first, blocking the other READXXX requests even if they<br>Could return Data. This is because of the nature of the antifreeze<br>Mechanism.</p></p><p><p>To avoid the effect, use a dedicated reader thread for each connection<br>Instead of Antifreeze. There is a tidtcpclient descendant and its own<br>Reader thread, firing an event if data arrive, at<br>Http://come.to/delphi-bits.</p></p><p><p>-michael</p></p><p><p></p></p><p><p></p></p><p><p></p></p><p><p></p></p>tidantifreezehierarchy, Properties, Methods, See Also, unit:idantifreezeprevents a application UI from Freezing.<pre class="Element12"><pre class="Element12"><strong>class</strong> (tidantifreezebase)</pre></pre>Unitidantifreezedescription<strong><strong>Indy works on the blocking model. That was when calls was made to Indy the does not return until they was Complete. If calls is made in the main thread this would cause the application User Interface to "freeze" during Indy calls. Tidantifreeze counter acts this Effect. Tidantifreeze allows Indy subsystem to make process application message calls so, Windows messages continue to be exec uted while Indy blocking socket calls is in Effect.</strong></strong><p class="Element10"><p class="Element10">Only one tidantifreeze can is active in an Application. If Another instance already exists, an exception is Raised. Tidantifreezebase uses the global variable gantifreeze, declared in the Tidantifreezebase unit, to determine if another in Stance has already been created.</p></p><p class="Element10"><p class="Element10"><strong>note:</strong> Gantifreeze is not assigned if a instance is added in the form designer (during design time).</p></p><p class="Element10"><p class="Element10"><strong>note:</strong> The Tidantifreeze.pas unit must <strong></strong> not appear on the uses clause of any Indy or descendant unit. This unit was linked in an application when the component was placed on a Form. This is the preserve isolation from the Forms.pas and Qforms.pas Units.</p></p>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.