System.Runtime.Remoting.Channels.AsyncWorkItem.FinishAsyncWorkCallback C# (CSharp) Method

FinishAsyncWorkCallback() static private method

static private FinishAsyncWorkCallback ( Object args ) : Object
args Object
return Object
        internal static Object FinishAsyncWorkCallback(Object[] args)
        {
            AsyncWorkItem This = (AsyncWorkItem) args[0];
            Context srvCtx = This._srvID.ServerContext;
            
            LogicalCallContext threadPoolCallCtx = 
                CallContext.SetLogicalCallContext(This._callCtx);

            // Call the server context chain Async. We provide workItem as our
            // replySink ... this will cause the replySink.ProcessMessage 
            // to switch back to the context of the original caller thread.
    
            // Call the dynamic sinks to notify that the async call
            // is starting
            srvCtx.NotifyDynamicSinks(
                This._reqMsg,
                false,  // bCliSide
                true,   // bStart
                true,   // bAsync
                true);  // bNotifyGlobals

            IMessageCtrl ctrl = 
               srvCtx.GetServerContextChain().AsyncProcessMessage(
                    This._reqMsg, 
                    (IMessageSink)This);

            // change back to the old context        
            CallContext.SetLogicalCallContext(threadPoolCallCtx);
            
            return null;
        }