Example #1
0
        public IMessage SyncProcessMessage(IMessage msg)
        {
            Ior target = DetermineTarget(msg);

            VerifyInterfaceCompatible(target, msg);
            // serialise
            IMessage result          = null;
            int      numberOfRetries = 0;

            while (true)
            {
                try {
                    result = SyncProcessMessageOnce(msg, target);
                    break;
                } catch (Exception e) {
                    if (!CanRetryOnException(e, numberOfRetries))
                    {
                        result = new ReturnMessage(e, (IMethodCallMessage)msg);
                        break;
                    }
                    numberOfRetries++;
                    m_retries.DelayNextRetryIfNeeded();
                }
            }
            return(result);
        }