static private IsLocalCall ( IMessage callMsg ) : bool | ||
callMsg | IMessage | |
return | bool |
/// <summary>Asynchronously dispatches the given message to the server-side chain(s) based on the URI embedded in the message.</summary> /// <returns>A <see cref="T:System.Runtime.Remoting.Messaging.IMessageCtrl" /> object used to control the asynchronously dispatched message.</returns> /// <param name="msg">The message to dispatch. </param> /// <param name="replySink">The sink that will process the return message if it is not null. </param> /// <exception cref="T:System.ArgumentNullException">The <paramref name="msg" /> parameter is null. </exception> /// <exception cref="T:System.Security.SecurityException">The immediate caller does not have infrastructure permission. </exception> /// <PermissionSet> /// <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="MemberAccess" /> /// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" /> /// </PermissionSet> public static IMessageCtrl AsyncDispatchMessage(IMessage msg, IMessageSink replySink) { IMessage message = ChannelServices.CheckIncomingMessage(msg); if (message != null) { replySink.SyncProcessMessage(ChannelServices.CheckReturnMessage(msg, message)); return(null); } if (RemotingConfiguration.CustomErrorsEnabled(ChannelServices.IsLocalCall(msg))) { replySink = new ExceptionFilterSink(msg, replySink); } return(ChannelServices._crossContextSink.AsyncProcessMessage(msg, replySink)); }
internal static IMessage CheckReturnMessage(IMessage callMsg, IMessage retMsg) { IMethodReturnMessage methodReturnMessage = retMsg as IMethodReturnMessage; if (methodReturnMessage != null && methodReturnMessage.Exception != null && RemotingConfiguration.CustomErrorsEnabled(ChannelServices.IsLocalCall(callMsg))) { Exception e = new Exception("Server encountered an internal error. For more information, turn off customErrors in the server's .config file."); retMsg = new MethodResponse(e, (IMethodCallMessage)callMsg); } return(retMsg); }