Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8431505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:52:23+00:00 2026-06-10T05:52:23+00:00

Delphi XE2, Indy V10, Windows 7 Pro – but I think I have a

  • 0

Delphi XE2, Indy V10, Windows 7 Pro – but I think I have a general conceptual problem.

  1. Indy’s TCP client is synchronous – it uses blocking calls.
  2. However parts of my application are asynchronous – I want to send data over TCP and wait for a response when
    A) the 3rd party serial port component reports input from the serial port (it appears to be asynchronous & run in it’s own thread, posting messages to my application’s main form’s Windows message queue) and
    B) when one of several timers expires (also asynchronous)
  3. My application’s handling of these async events needs to make a blocking call to send data over TCP and get a response before the next TCP data can be sent. E.G.

    procedure OnSerialPortRxChar(...);
    begin  
      if SendTCpData(...) = 'OK' then ...  
    end;  
    
    procedure OnTimerExpiry(...);  
    begin  
      if SendTCpData(...) = 'OK' then ...  
    end;  
    

These should not interrupt each other, but currently do.

Obviously, my function SendTCpData needs some sort of blocking mechanism to prevent reentrant calls, or a queuing mechanism. Given that the caller needs to know the result, is my best solution a mutex? The problem is that the TCP transaction is just one line in the 20 line SendTCpData function which those asynch events can invoke.

I hope that I have explained this comprehendably. If not, please request more information.

Thank you very much in advance for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:52:25+00:00Added an answer on June 10, 2026 at 5:52 am

    You can use TIdAntiFreeze. Just drop it on your main form. Your call will still be blocked but your GUI will not be blocked. You may want to use some timeouts with your client though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Delphi XE2, so Indy 10. My client sends a command which is processed by
Delphi XE2 starter for me, but maybe a general answer will help others ...
I'm using Delphi XE2 and Indy 10.5.8.0. I have an instance of TIdHttp and
Delphi XE2, so I guess that is Indy 10(?). One server, 10 clients. I
I have a Delphi XE2 project having components like Label1 , BitBtn1 and Image1
The Delphi XE2 skinning option is fantastic, but there are cases where you want
I have ZipForge for Delphi XE2 & Delphi XE2. I try to test any
I have a client/server application written in delphiXe2 using Indy TIdTCPServer and TIdTCPClient that
I have a Delphi XE2 Firemonkey application that I want to run on both
We are porting our app to Delphi XE2 from Delphi 6. Problem is, the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.