all groups > dotnet remoting > september 2004 >
You're in the

dotnet remoting

group:

Repost: CallContext.GetData - cannot be used in the constructor of the Server object (Remoting)



Repost: CallContext.GetData - cannot be used in the constructor of the Server object (Remoting) José Joye
9/20/2004 7:40:40 AM
dotnet remoting: I'm playing around with the "CallContext" class to pass around extra
information between my client and Server applications (implemented with
Remoting).
My Server is a SAO-singlecall.

If I try to use the CallContext.GetData() method to retrieved information
from within a method in the Server part, all if fine.
If I try to do it from within the Constructor (which is called each time
prior a method is executed on the Server [singlecall]), the information is
not available ?????

I tried to look at the MSDN documentation about when such a information is
made available. However, I did not find anything...
Can anyone tell me the reason why the "CallContext" information is not
available when the Server Object Constructor is called?

Thanks a lot,
José


Re: Repost: CallContext.GetData - cannot be used in the constructor of the Server object (Remoting) Lord2702
9/20/2004 11:12:31 AM
Mon. Sep. 20, 2004 11:10 AM PT

I suppose your described scenario is exactly the same as I have in my
application. The reason is, that you are not able to get the CallContext in
the MBRO's ctor, because, this CallContext is available, only after the MBRO
is completely constructed, in other words, when its ctor execute comletely
only then in MBRO's method it is available.

You can see the behavior of SingleCall, ctor is not very important, as the
object is state-less, as soon it finishes its call it dispose it off. Hence,
I think CallContext is only available in MBRO's method call. It is not
clearly mentioned anywhere in MSDN, but if you read again the description
about the CallContext, and its examples, you will notice this fact.

Good Luck !!!

[quoted text, click to view]

Re: Repost: CallContext.GetData - cannot be used in the constructor of the Server object (Remoting) José Joye
9/20/2004 9:09:33 PM
Thanks for your reply...

I guess I have to live with it... and in each method call a special utility
method to get the content of the callContext.
This is not what I was expecting...

José

"Lord2702" <Lord2702@MSN.com> a écrit dans le message de
news:ujSAn1znEHA.2948@TK2MSFTNGP11.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button