[twsocket] Adjust THttpClient->Get() timeout?

Wilfried Mestdagh wilfried_sonal@compuserve.com
Tue, 20 Jun 2000 10:11:55 +0200


Peter,

You should not have access violations if the connection is still open while
closing the application. It could be some event that is fired. eg.: updating
a statusbar in OnChangeState event will give you access violation when
closing. If you do something like that you have to check if
Application.Terminated.

rgds, Wilfried

> -----Original Message-----
> From: twsocket-admin@elists.org [mailto:twsocket-admin@elists.org]On
> Behalf Of Peter Immarco
> Sent: dinsdag 20 juni 2000 2:21
> To: twsocket@elists.org
> Subject: Re: [twsocket] Adjust THttpClient->Get() timeout?
>
>
>
> Wilfried,
>
> Actually I was getting some bad Access Violations and other
> weirdnesses until I
> put an HttpCli->Abort() followed by an
> Application->ProcessMessages() in the
> FormClose() event for the form that contains the HttpCli
> component, which is
> not the main form.  In addition I had to forcefully call the
> FormThatHasHttpCli->Close() event function because when the main form
> terminates, it doesn't call all the FormClose() events on the
> other forms that
> belong to that App, I know because I tested this.  I would guess that
> FormDestroy() is called even if FormClose() is not, I didn't test
> that, but I
> have a subconscious aversion to putting too much code in the FormDestroy()
> event.
>
> Peter.
>
> Wilfried Mestdagh wrote:
>
> > Peter,
> >
> > No need to close. The socket connection will close when your application
> > terminate. You can leave the Abort method but dont need to call
> the message
> > pump.
> >
> > rgds, Wilfried
> >
> > > -----Original Message-----
> > > From: twsocket-admin@elists.org [mailto:twsocket-admin@elists.org]On
> > > Behalf Of Peter Immarco
> > > Sent: maandag 19 juni 2000 23:59
> > > To: twsocket@elists.org
> > > Subject: Re: [twsocket] Adjust THttpClient->Get() timeout?
> > >
> > >
> > >
> > > Francois,
> > >
> > > Ok.  One last question.  In my form close event (FormClose()) for
> > > the form that
> > > contains the THttpCli instance, I do a THttpCli->Abort() followed
> > > by a single
> > > Application->ProcesseMessages() statement.  Is that sufficient or
> > > do I need to
> > > enter some kind of wait loop waiting for THttpCli to shut down
> > > cleanly?  If so,
> > > what would the loop look like?
> > >
> > > Peter.