Ejemplo n.º 1
0
        public void ProcessFrame(Frame frame)
        {
            Performative command = frame.Command;

            try
            {
                if (command.DescriptorCode == Attach.Code)
                {
                    this.OnReceiveAttach((Attach)command);
                }
                else if (command.DescriptorCode == Detach.Code)
                {
                    this.OnReceiveDetach((Detach)command);
                }
                else if (command.DescriptorCode != Transfer.Code)
                {
                    if (command.DescriptorCode != Flow.Code)
                    {
                        throw new AmqpException(AmqpError.InvalidField, SRAmqp.AmqpInvalidPerformativeCode(command.DescriptorCode));
                    }
                    this.OnReceiveFlow((Flow)command);
                }
                else
                {
                    this.OnReceiveTransfer((Transfer)command, frame);
                }
            }
            catch (Exception exception1)
            {
                Exception exception = exception1;
                if (Fx.IsFatal(exception))
                {
                    throw;
                }
                MessagingClientEtwProvider.TraceClient <AmqpLink, Exception>((AmqpLink source, Exception ex) => MessagingClientEtwProvider.Provider.EventWriteAmqpLogError(source, "ProcessFrame", ex.Message), this, exception);
                base.SafeClose(exception);
            }
        }