Jump to content
Mark-

THttpCli.Close...

Recommended Posts

Hello,

 

THttpCli version 8.62

 

Update: Thinking about it "blocking" is what the code says and what it does. I switched to CloseAsync and that seems to solve the issue. More testing will prove. Is there a better idea?

 

I have a THttpCli component on a TDataModule connected to a camera. When the user closes the main form, I call:

  HttpCli1.Abort;
  HttpCli1.Close;

Abort returns and Close is called.

Close never returns because:

if MsgWaitForMultipleObjects(0, Pointer(nil)^, FALSE, 1000, QS_ALLINPUT) = WAIT_OBJECT_0 then
 MessagePump;

is called, and MessagePump calls:

Application.ProcessMessages;

Ideas?

 

Thanks,

 

Mark

Edited by Mark-

Share this post


Link to post

When closing the main form, that is closing the application, it is enough to call Abort. And if you really want to call Close, don't call Abort just before. Calling Abort will do a hard close of the TCP session, without waiting the remote side to acknowledge (It will trigger an error there). Calling close will do an orderly close (No error at remote side). A web server, even in a camera should not care about hard close.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×