Re: [twsocket] best way to reset HttpCli
Francois, See my post, it is not sufficient to use OnRequestDone. There might still be messages pending in case of abort/network error when SetReady is called twice! Regards, SZ On Sun, Oct 19, 2008 at 11:34 AM, Francois PIETTE <[EMAIL PROTECTED] > wrote: > > I am using a httpcli created on run-time. I first connect to a website, > > and after DocEnd I call another procedure that changes the event > > procedures and connects to a different website. On the 2nd call I get an > > Exception "HTTP component is busy", so I do this before trying the 2nd > > call > > > > try > >LoginSocket.Abort; > > except > > end; > > > > that, however, generates another exception. Checking the httpcli state > > before the abort, it is "Waiting Body" > > > > What is the best way to "reset" the component between both calls and > leave > > it in a "Ready" state? The first call is GetAsync and the 2nd one is > > PostAsync. > > Do not use OnDocEnd to start the next connection but OnRequestDone. > OnDocEnd is when the document is complete (Time to commit in database for > example) while OnRequestDone tells you the component has finished your > request and is ready for the next one. > > -- > [EMAIL PROTECTED] > The author of the freeware multi-tier middleware MidWare > The author of the freeware Internet Component Suite (ICS) > http://www.overbyte.be > > -- > -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] best way to reset HttpCli
> I am using a httpcli created on run-time. I first connect to a website, > and after DocEnd I call another procedure that changes the event > procedures and connects to a different website. On the 2nd call I get an > Exception "HTTP component is busy", so I do this before trying the 2nd > call > > try >LoginSocket.Abort; > except > end; > > that, however, generates another exception. Checking the httpcli state > before the abort, it is "Waiting Body" > > What is the best way to "reset" the component between both calls and leave > it in a "Ready" state? The first call is GetAsync and the 2nd one is > PostAsync. Do not use OnDocEnd to start the next connection but OnRequestDone. OnDocEnd is when the document is complete (Time to commit in database for example) while OnRequestDone tells you the component has finished your request and is ready for the next one. -- [EMAIL PROTECTED] The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] best way to reset HttpCli
Make a property for it in the derived class then. This method would be much faster than object recreation! On Sat, Oct 18, 2008 at 11:38 PM, brian <[EMAIL PROTECTED]> wrote: > I can't access FMsg_WM_HTTP_SET_READY because it's under Protected > > - Original Message - > From: "Paul" <[EMAIL PROTECTED]> > To: "ICS support mailing" > Sent: Saturday, October 18, 2008 21:40 > Subject: Re: [twsocket] best way to reset HttpCli > > > >I think so, > > > > If you call Abort, OnRequestdone will be triggered. > > You can set a flag when you call abort, and then you can take action in > > OnRequestdone. > > You problably have to free some streams anyway, which are usually freed > in > > OnRequestdone. > > > > Paul > > > > > > > > - Original Message ----- > > From: "brian" <[EMAIL PROTECTED]> > > To: "ICS support mailing" > > Sent: Saturday, October 18, 2008 9:15 PM > > Subject: Re: [twsocket] best way to reset HttpCli > > > > > >> You mean I should post the message and wait for the next call until > >> OnRequestDone triggers? > >> > >> where is FMsg_WM_HTTP_SET_READY defined? > >> > >> thanks > >> > >> - Original Message - > >> From: "Fastream Technologies" <[EMAIL PROTECTED]> > >> To: "ICS support mailing" > >> Sent: Saturday, October 18, 2008 15:47 > >> Subject: Re: [twsocket] best way to reset HttpCli > >> > >> > >>>I reported this as BUG in 2007. Then nobody seemed to find a real > >>>solution > >>> and I found a workaround: > >>> > >>> I created a descendent in C++ and, > >>> > >>> void __fastcall httpClient::SetReady() > >>> { > >>> if(alreadySetReady) > >>> return; > >>> alreadySetReady = true; > >>> PostMessage(FHandle, FMsg_WM_HTTP_SET_READY, 0, 0); > >>> } > >>> > //--- > >>> alreadysettrue is reset before each get/head/postasync. Then you should > >>> enter your next call in ONRequestdone. It has complex reasons yet if > you > >>> really want to know, breakpoint the original setready. > >>> > >>> Regards, > >>> > >>> SZ > >>> > >>> On Sat, Oct 18, 2008 at 3:16 PM, brian <[EMAIL PROTECTED]> wrote: > >>> > >>>> Hi, > >>>> > >>>> I am using a httpcli created on run-time. I first connect to a > website, > >>>> and > >>>> after DocEnd I call another procedure that changes the event > procedures > >>>> and > >>>> connects to a different website. On the 2nd call I get an Exception > >>>> "HTTP > >>>> component is busy", so I do this before trying the 2nd call > >>>> > >>>> try > >>>>LoginSocket.Abort; > >>>> except > >>>> end; > >>>> > >>>> that, however, generates another exception. Checking the httpcli state > >>>> before the abort, it is "Waiting Body" > >>>> > >>>> What is the best way to "reset" the component between both calls and > >>>> leave > >>>> it in a "Ready" state? The first call is GetAsync and the 2nd one is > >>>> PostAsync. > >>>> -- > >>>> To unsubscribe or change your settings for TWSocket mailing list > >>>> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket > >>>> Visit our website at http://www.overbyte.be > >>>> > >>> -- > >>> To unsubscribe or change your settings for TWSocket mailing list > >>> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket > >>> Visit our website at http://www.overbyte.be > >> > >> -- > >> To unsubscribe or change your settings for TWSocket mailing list > >> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket > >> Visit our website at http://www.overbyte.be > >> > >> > > > > -- > > To unsubscribe or change your settings for TWSocket mailing list > > please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket > > Visit our website at http://www.overbyte.be > > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be > -- Gorkem Ates Fastream Technologies Software IQ: Innovation & Quality www.fastream.com | Email: [EMAIL PROTECTED] | Tel: +90-312-223-2830 | MSN: [EMAIL PROTECTED] Join IQWF Server Yahoo group at http://groups.yahoo.com/group/IQWFServer Join IQ Reverse Proxy Yahoo group at http://groups.yahoo.com/group/IQReverseProxy -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] best way to reset HttpCli
I've decided to just free/re-create the httpcli at run-time, works the best. thanks - Original Message - From: "Paul" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Saturday, October 18, 2008 21:40 Subject: Re: [twsocket] best way to reset HttpCli >I think so, > > If you call Abort, OnRequestdone will be triggered. > You can set a flag when you call abort, and then you can take action in > OnRequestdone. > You problably have to free some streams anyway, which are usually freed in > OnRequestdone. > > Paul > > > > - Original Message - > From: "brian" <[EMAIL PROTECTED]> > To: "ICS support mailing" > Sent: Saturday, October 18, 2008 9:15 PM > Subject: Re: [twsocket] best way to reset HttpCli > > >> You mean I should post the message and wait for the next call until >> OnRequestDone triggers? >> >> where is FMsg_WM_HTTP_SET_READY defined? >> >> thanks >> >> - Original Message ----- >> From: "Fastream Technologies" <[EMAIL PROTECTED]> >> To: "ICS support mailing" >> Sent: Saturday, October 18, 2008 15:47 >> Subject: Re: [twsocket] best way to reset HttpCli >> >> >>>I reported this as BUG in 2007. Then nobody seemed to find a real >>>solution >>> and I found a workaround: >>> >>> I created a descendent in C++ and, >>> >>> void __fastcall httpClient::SetReady() >>> { >>> if(alreadySetReady) >>> return; >>> alreadySetReady = true; >>> PostMessage(FHandle, FMsg_WM_HTTP_SET_READY, 0, 0); >>> } >>> //--- >>> alreadysettrue is reset before each get/head/postasync. Then you should >>> enter your next call in ONRequestdone. It has complex reasons yet if you >>> really want to know, breakpoint the original setready. >>> >>> Regards, >>> >>> SZ >>> >>> On Sat, Oct 18, 2008 at 3:16 PM, brian <[EMAIL PROTECTED]> wrote: >>> >>>> Hi, >>>> >>>> I am using a httpcli created on run-time. I first connect to a website, >>>> and >>>> after DocEnd I call another procedure that changes the event procedures >>>> and >>>> connects to a different website. On the 2nd call I get an Exception >>>> "HTTP >>>> component is busy", so I do this before trying the 2nd call >>>> >>>> try >>>>LoginSocket.Abort; >>>> except >>>> end; >>>> >>>> that, however, generates another exception. Checking the httpcli state >>>> before the abort, it is "Waiting Body" >>>> >>>> What is the best way to "reset" the component between both calls and >>>> leave >>>> it in a "Ready" state? The first call is GetAsync and the 2nd one is >>>> PostAsync. >>>> -- >>>> To unsubscribe or change your settings for TWSocket mailing list >>>> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket >>>> Visit our website at http://www.overbyte.be >>>> >>> -- >>> To unsubscribe or change your settings for TWSocket mailing list >>> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket >>> Visit our website at http://www.overbyte.be >> >> -- >> To unsubscribe or change your settings for TWSocket mailing list >> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket >> Visit our website at http://www.overbyte.be >> >> > > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] best way to reset HttpCli
I can't access FMsg_WM_HTTP_SET_READY because it's under Protected - Original Message - From: "Paul" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Saturday, October 18, 2008 21:40 Subject: Re: [twsocket] best way to reset HttpCli >I think so, > > If you call Abort, OnRequestdone will be triggered. > You can set a flag when you call abort, and then you can take action in > OnRequestdone. > You problably have to free some streams anyway, which are usually freed in > OnRequestdone. > > Paul > > > > - Original Message - > From: "brian" <[EMAIL PROTECTED]> > To: "ICS support mailing" > Sent: Saturday, October 18, 2008 9:15 PM > Subject: Re: [twsocket] best way to reset HttpCli > > >> You mean I should post the message and wait for the next call until >> OnRequestDone triggers? >> >> where is FMsg_WM_HTTP_SET_READY defined? >> >> thanks >> >> - Original Message ----- >> From: "Fastream Technologies" <[EMAIL PROTECTED]> >> To: "ICS support mailing" >> Sent: Saturday, October 18, 2008 15:47 >> Subject: Re: [twsocket] best way to reset HttpCli >> >> >>>I reported this as BUG in 2007. Then nobody seemed to find a real >>>solution >>> and I found a workaround: >>> >>> I created a descendent in C++ and, >>> >>> void __fastcall httpClient::SetReady() >>> { >>> if(alreadySetReady) >>> return; >>> alreadySetReady = true; >>> PostMessage(FHandle, FMsg_WM_HTTP_SET_READY, 0, 0); >>> } >>> //--- >>> alreadysettrue is reset before each get/head/postasync. Then you should >>> enter your next call in ONRequestdone. It has complex reasons yet if you >>> really want to know, breakpoint the original setready. >>> >>> Regards, >>> >>> SZ >>> >>> On Sat, Oct 18, 2008 at 3:16 PM, brian <[EMAIL PROTECTED]> wrote: >>> >>>> Hi, >>>> >>>> I am using a httpcli created on run-time. I first connect to a website, >>>> and >>>> after DocEnd I call another procedure that changes the event procedures >>>> and >>>> connects to a different website. On the 2nd call I get an Exception >>>> "HTTP >>>> component is busy", so I do this before trying the 2nd call >>>> >>>> try >>>>LoginSocket.Abort; >>>> except >>>> end; >>>> >>>> that, however, generates another exception. Checking the httpcli state >>>> before the abort, it is "Waiting Body" >>>> >>>> What is the best way to "reset" the component between both calls and >>>> leave >>>> it in a "Ready" state? The first call is GetAsync and the 2nd one is >>>> PostAsync. >>>> -- >>>> To unsubscribe or change your settings for TWSocket mailing list >>>> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket >>>> Visit our website at http://www.overbyte.be >>>> >>> -- >>> To unsubscribe or change your settings for TWSocket mailing list >>> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket >>> Visit our website at http://www.overbyte.be >> >> -- >> To unsubscribe or change your settings for TWSocket mailing list >> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket >> Visit our website at http://www.overbyte.be >> >> > > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] best way to reset HttpCli
I think so, If you call Abort, OnRequestdone will be triggered. You can set a flag when you call abort, and then you can take action in OnRequestdone. You problably have to free some streams anyway, which are usually freed in OnRequestdone. Paul - Original Message - From: "brian" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Saturday, October 18, 2008 9:15 PM Subject: Re: [twsocket] best way to reset HttpCli > You mean I should post the message and wait for the next call until > OnRequestDone triggers? > > where is FMsg_WM_HTTP_SET_READY defined? > > thanks > > - Original Message - > From: "Fastream Technologies" <[EMAIL PROTECTED]> > To: "ICS support mailing" > Sent: Saturday, October 18, 2008 15:47 > Subject: Re: [twsocket] best way to reset HttpCli > > >>I reported this as BUG in 2007. Then nobody seemed to find a real solution >> and I found a workaround: >> >> I created a descendent in C++ and, >> >> void __fastcall httpClient::SetReady() >> { >> if(alreadySetReady) >> return; >> alreadySetReady = true; >> PostMessage(FHandle, FMsg_WM_HTTP_SET_READY, 0, 0); >> } >> //--- >> alreadysettrue is reset before each get/head/postasync. Then you should >> enter your next call in ONRequestdone. It has complex reasons yet if you >> really want to know, breakpoint the original setready. >> >> Regards, >> >> SZ >> >> On Sat, Oct 18, 2008 at 3:16 PM, brian <[EMAIL PROTECTED]> wrote: >> >>> Hi, >>> >>> I am using a httpcli created on run-time. I first connect to a website, >>> and >>> after DocEnd I call another procedure that changes the event procedures >>> and >>> connects to a different website. On the 2nd call I get an Exception >>> "HTTP >>> component is busy", so I do this before trying the 2nd call >>> >>> try >>>LoginSocket.Abort; >>> except >>> end; >>> >>> that, however, generates another exception. Checking the httpcli state >>> before the abort, it is "Waiting Body" >>> >>> What is the best way to "reset" the component between both calls and >>> leave >>> it in a "Ready" state? The first call is GetAsync and the 2nd one is >>> PostAsync. >>> -- >>> To unsubscribe or change your settings for TWSocket mailing list >>> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket >>> Visit our website at http://www.overbyte.be >>> >> -- >> To unsubscribe or change your settings for TWSocket mailing list >> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket >> Visit our website at http://www.overbyte.be > > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be > > -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] best way to reset HttpCli
You mean I should post the message and wait for the next call until OnRequestDone triggers? where is FMsg_WM_HTTP_SET_READY defined? thanks - Original Message - From: "Fastream Technologies" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Saturday, October 18, 2008 15:47 Subject: Re: [twsocket] best way to reset HttpCli >I reported this as BUG in 2007. Then nobody seemed to find a real solution > and I found a workaround: > > I created a descendent in C++ and, > > void __fastcall httpClient::SetReady() > { > if(alreadySetReady) > return; > alreadySetReady = true; > PostMessage(FHandle, FMsg_WM_HTTP_SET_READY, 0, 0); > } > //--- > alreadysettrue is reset before each get/head/postasync. Then you should > enter your next call in ONRequestdone. It has complex reasons yet if you > really want to know, breakpoint the original setready. > > Regards, > > SZ > > On Sat, Oct 18, 2008 at 3:16 PM, brian <[EMAIL PROTECTED]> wrote: > >> Hi, >> >> I am using a httpcli created on run-time. I first connect to a website, >> and >> after DocEnd I call another procedure that changes the event procedures >> and >> connects to a different website. On the 2nd call I get an Exception "HTTP >> component is busy", so I do this before trying the 2nd call >> >> try >>LoginSocket.Abort; >> except >> end; >> >> that, however, generates another exception. Checking the httpcli state >> before the abort, it is "Waiting Body" >> >> What is the best way to "reset" the component between both calls and >> leave >> it in a "Ready" state? The first call is GetAsync and the 2nd one is >> PostAsync. >> -- >> To unsubscribe or change your settings for TWSocket mailing list >> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket >> Visit our website at http://www.overbyte.be >> > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] best way to reset HttpCli
I reported this as BUG in 2007. Then nobody seemed to find a real solution and I found a workaround: I created a descendent in C++ and, void __fastcall httpClient::SetReady() { if(alreadySetReady) return; alreadySetReady = true; PostMessage(FHandle, FMsg_WM_HTTP_SET_READY, 0, 0); } //--- alreadysettrue is reset before each get/head/postasync. Then you should enter your next call in ONRequestdone. It has complex reasons yet if you really want to know, breakpoint the original setready. Regards, SZ On Sat, Oct 18, 2008 at 3:16 PM, brian <[EMAIL PROTECTED]> wrote: > Hi, > > I am using a httpcli created on run-time. I first connect to a website, and > after DocEnd I call another procedure that changes the event procedures and > connects to a different website. On the 2nd call I get an Exception "HTTP > component is busy", so I do this before trying the 2nd call > > try >LoginSocket.Abort; > except > end; > > that, however, generates another exception. Checking the httpcli state > before the abort, it is "Waiting Body" > > What is the best way to "reset" the component between both calls and leave > it in a "Ready" state? The first call is GetAsync and the 2nd one is > PostAsync. > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be > -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] best way to reset HttpCli
Hi, I am using a httpcli created on run-time. I first connect to a website, and after DocEnd I call another procedure that changes the event procedures and connects to a different website. On the 2nd call I get an Exception "HTTP component is busy", so I do this before trying the 2nd call try LoginSocket.Abort; except end; that, however, generates another exception. Checking the httpcli state before the abort, it is "Waiting Body" What is the best way to "reset" the component between both calls and leave it in a "Ready" state? The first call is GetAsync and the 2nd one is PostAsync. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be