ExecuteMessage() private method

private ExecuteMessage ( MarshalByRefObject target, IMethodCallMessage reqMsg ) : IMethodReturnMessage
target System.MarshalByRefObject
reqMsg IMethodCallMessage
return IMethodReturnMessage
Esempio n. 1
0
        } // ComRedirectionProxy

        public virtual IMessage SyncProcessMessage(IMessage msg)
        {
            IMethodCallMessage   mcmReqMsg = (IMethodCallMessage)msg;
            IMethodReturnMessage replyMsg  = null;

            replyMsg = RemotingServices.ExecuteMessage(_comObject, mcmReqMsg);

            if (replyMsg != null)
            {
                // If an "RPC server not available" (HRESULT=0x800706BA) COM
                //   exception is thrown, we will try to recreate the object once.
                const int    RPC_S_SERVER_UNAVAILABLE = unchecked ((int)0x800706BA);
                const int    RPC_S_CALL_FAILED_DNE    = unchecked ((int)0x800706BF);
                COMException comException             = replyMsg.Exception as COMException;
                if ((comException != null) &&
                    ((comException._HResult == RPC_S_SERVER_UNAVAILABLE) ||
                     (comException._HResult == RPC_S_CALL_FAILED_DNE)))
                {
                    _comObject = (MarshalByRefObject)Activator.CreateInstance(_serverType, true);

                    replyMsg = RemotingServices.ExecuteMessage(_comObject, mcmReqMsg);
                }
            }

            return(replyMsg);
        } // SyncProcessMessage
Esempio n. 2
0
        public virtual IMessage SyncProcessMessage(IMessage msg)
        {
            IMethodCallMessage   reqMsg = (IMethodCallMessage)msg;
            IMethodReturnMessage methodReturnMessage = RemotingServices.ExecuteMessage(this._comObject, reqMsg);

            if (methodReturnMessage != null)
            {
                COMException comException = methodReturnMessage.Exception as COMException;
                if (comException != null && (comException._HResult == -2147023174 || comException._HResult == -2147023169))
                {
                    this._comObject     = (MarshalByRefObject)Activator.CreateInstance(this._serverType, true);
                    methodReturnMessage = RemotingServices.ExecuteMessage(this._comObject, reqMsg);
                }
            }
            return((IMessage)methodReturnMessage);
        }
        public virtual IMessage SyncProcessMessage(IMessage msg)
        {
            IMethodCallMessage   reqMsg   = (IMethodCallMessage)msg;
            IMethodReturnMessage message2 = null;

            message2 = RemotingServices.ExecuteMessage(this._comObject, reqMsg);
            if (message2 == null)
            {
                return(message2);
            }
            COMException exception = message2.Exception as COMException;

            if ((exception == null) || ((exception._HResult != -2147023174) && (exception._HResult != -2147023169)))
            {
                return(message2);
            }
            this._comObject = (MarshalByRefObject)Activator.CreateInstance(this._serverType, true);
            return(RemotingServices.ExecuteMessage(this._comObject, reqMsg));
        }