System.Runtime.Remoting.Activation.ActivationServices.ActivateWithMessage()

类别:.NET开发 点击:0 评论:0 推荐:

internal static object ActivateWithMessage(Type serverType, IMessage msg, ServerIdentity srvIdToBind, out Exception e) { object obj1 = null; e = null; obj1 = RemotingServices.AllocateUninitializedObject(serverType); object obj2 = null; if (serverType.IsContextful) { if (msg is ConstructorCallMessage) { obj2 = ((ConstructorCallMessage) msg).GetThisPtr(); } else { obj2 = null; } obj2 = RemotingServices.Wrap((ContextBoundObject) obj1, obj2, false); } else { if (Thread.CurrentContext != Context.DefaultContext) { throw new RemotingException(Environment.GetResourceString("Remoting_Activation_Failed")); } obj2 = obj1; } IMessageSink sink1 = new StackBuilderSink(obj2); IMethodReturnMessage message1 = (IMethodReturnMessage) sink1.SyncProcessMessage(msg); if (message1.Exception == null) { if (serverType.IsContextful) { return RemotingServices.Wrap((ContextBoundObject) obj1); } return obj1; } e = message1.Exception; return null; }

本文地址:http://com.8s8s.com/it/it41098.htm