[Mono-devel-list] Repost: Question: Using the CallContext class from a custom channel sink.

Sébastien Robitaille sebastien.robitaille at croesus.com
Wed Nov 17 09:12:44 EST 2004

My original message never reached the mono devel list ...
So, here it is again :-)


-----Original Message-----
From: Sébastien Robitaille
Sent: Wednesday, November 10, 2004 3:42 PM
To: Mono Development List
Subject: Question: Using the CallContext class from a custom channel


I am trying to use the class CallContext from a custom channel sink to set some properties that are required in my remote objects.

The problem I have is that the CallContext.GetData method always returns null with Mono(1.0.4) and the same code works fine with

In the ProcessMessage method of my custom channel sink:

CallContext.SetData("SOME_KEY", some_data);

And in the remote method body:

object data = CallContext.GetData("SOME_KEY")

But "data" is always null.

I had a quick look at mono source code and I think that this problem may be related to the way mono handles LogicalCallContexts (as
I understand, RemotingServices.InternalExecuteMessage temporary replaces the CallContext data by the LogicalCallContext instead of
"appending it" to the actual content. This may be the cause of this behavior).

Anyway, I already found a workaround (by directly using a Thread data slot instead of the CallContext class), but I was curious if
this is a bug or if I was using the CallContext class incorrectly.

Thanks for your help.

More information about the Mono-devel-list mailing list