|
|
|
date: Tue, 27 May 2008 04:57:16 -0700 (PDT),
group: microsoft.public.inetsdk.programming.urlmonikers
back
Re: Switch/Continue approach giving different thread id's
genius1232@yahoo.co.in wrote:
> 1.I am calling Switch() method from OnResponse() .
> 2.Then call goes to Continue() method .
> 3.In this Continue() method I am getting the thread ID using the
> function GetCurrentThreadId().
> 4. The thread Id's (for a single html page ) that I get are not all
> same. i.e for a single page I have multiple thread id's
>
> By calling switch the continue() should be called on the main thread,
> right !!
> Then how is it that I am getting different thread id's
I've tested it, and I get the same thread ID every time.
Be aware that the real protocol itself may call Switch, and receive
Continue. It may not pass PD_FORCE_SWITCH flag, and Continue call
resulting from such a Switch call may not arrive on the main thread. You
need to distinguish between your Continue calls arriving in response to
your calling Switch, and all other ones. Probably the easiest way is to
put some distinctive value into PROTOCOLDATA::dwState, and check for it
in Continue. If Continue comes with the same value, it's yours; if not,
you need to forward it on to the real protocol but otherwise ignore it.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
date: Tue, 27 May 2008 13:10:39 -0400
author: Igor Tandetnik
Re: Switch/Continue approach giving different thread id's
On May 27, 10:10 pm, "Igor Tandetnik" wrote:
> genius1...@yahoo.co.in wrote:
> > 1.I am calling Switch() method from OnResponse() .
> > 2.Then call goes to Continue() method .
> > 3.In this Continue() method I am getting the thread ID using the
> > function GetCurrentThreadId().
> > 4. The thread Id's (for a single html page ) that I get are not all
> > same. i.e for a single page I have multiple thread id's
>
> > By calling switch the continue() should be called on the main thread,
> > right !!
> > Then how is it that I am getting different thread id's
>
> I've tested it, and I get the same thread ID every time.
>
> Be aware that the real protocol itself may call Switch, and receive
> Continue. It may not pass PD_FORCE_SWITCH flag, and Continue call
> resulting from such a Switch call may not arrive on the main thread. You
> need to distinguish between your Continue calls arriving in response to
> your calling Switch, and all other ones. Probably the easiest way is to
> put some distinctive value into PROTOCOLDATA::dwState, and check for it
> in Continue. If Continue comes with the same value, it's yours; if not,
> you need to forward it on to the real protocol but otherwise ignore it.
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
Hello Igor,
Thank you so much ---- You have given such a brilliant solution for
identifying who is calling the Continue() method.
Thanks again for your guidance.
With Best Regards
Hitesh
date: Tue, 27 May 2008 10:43:14 -0700 (PDT)
author: unknown
|
|