The call context allows a remoting client and a remote object to share information without explicitly passing the information as a parameter or return value. Theclass provides a dictionary that can contain any number of objects that are marked as serializable and implement the interface. Objects are added to the CallContext by calling . Objects are retrieved from the CallContext by calling . Objects can be added to the CallContext at any time during the execution of the application.
The CallContext is scoped by thread. There is a separate CallContext object for each thread running in the application.
For a sample illustrating the use of the CallContext object, see.
The CallContext object is passed in a message (implementation) as the "__CallContext" property when a remote call is made. Message sinks can add and retrieve objects in the "__CallContext" property as it passes through the message sink chain.
Asynchronous processing and CallContext
Themethod passes the CallContext to the server. When the method is called, the data contained in the CallContext is copied back onto the thread that called BeginInvoke.