Partager via


CallContext

CallContext allows you to flow information with a "logical" call. With logical we mean the call doesnt necessarily have to happen on the same thread. Following constitute logical calls:

1. remoting calls made x-appdomain and x-process

2. Async delegate invokations which might execute on different thread.

The callcontext is serialized for remoting calls and carried for for async invokations. CallContext can be accessed using CallContext.GetData and SetData functions. Objects only travel outside the appdomain if they implement ILogicalThreadAffinative.

The CallContext doesnt flow for the following invokations:

1. Calls made to out-of-proc Serviced Components.

2. Invokations made using ThreadPool.QueueUserWorkItem

Comments