Maybe you did not catch the problem correctly If I make 2 subsequent calls to
Activator.GetObject with different id's in seperate threads it is using the
first one for two but if you make two calls again by waiting sometime it
workes as it is supposed to be.
> The third parameter of the Activator.GetObject has the purpose to send
> information to the channel and it is used at the client channel setup time
[quoted text clipped - 28 lines]
> >
> > Dincer Uyav
Dumitru Sbenghe - 23 Nov 2005 10:08 GMT
It's possible that I didn't understand your problem; but I think I did.
So you call Activator.GetObject passing the user id as a third parameter.
This parameter is passed to IChannelSender.CreateMessageSink of the channel,
which in turn will call in chain all the client channel providers. At this
moment yours UserSinkProvider.CreateMessageSink is called; probably in this
method you save the user id, probably in the sink; and you try to use it in
the ProcessMessage method of the sink for every method call. But this sink
chain building is happening only once.
As I explained to you in the first message, your CreateMessageSink is called
only once during the first Activator.GetObject.
That is what I understand from you description. If is not that you can try
to describe the problem more clearly.
The third parameter of Activator.GetObject is not meant to be used in the
way you try to use it. For this kind of purposes you can use thread local
storage, CallContext or the IPrincipal interface.
Dumitru
> Maybe you did not catch the problem correctly If I make 2 subsequent calls
> to
> Activator.GetObject with different id's in seperate threads it is using
> the
> first one for two but if you make two calls again by waiting sometime it
> workes as it is supposed to be.