This class logs the frame activity on session and dumps them into a file for debugging issues that are difficult to repro under debugger. The output file is named as "session#.log" and it contains lines as follows: ticks(10000) direction op p1 p2 1653194746831 9 RECV 17 0 0 1653194746844 9 SEND 17 0 0 Refer to the calls to AmqpDebug.Log for parameter definition. Enable this logging by including AMQP_DEBUG constant in the project file for the desired build configuration.
Esempio n. 1
0
        /// <summary>
        /// Processes session and link frames.
        /// </summary>
        /// <param name="frame">The received frame.</param>
        public virtual void ProcessFrame(Frame frame)
        {
            Performative command = frame.Command;

            try
            {
                AmqpDebug.Log(this, false, command);

                if (command.DescriptorCode == Begin.Code)
                {
                    this.OnReceiveBegin((Begin)command);
                }
                else if (command.DescriptorCode == End.Code)
                {
                    this.OnReceiveEnd((End)command);
                }
                else if (command.DescriptorCode == Disposition.Code)
                {
                    this.OnReceiveDisposition((Disposition)command);
                }
                else if (command.DescriptorCode == Flow.Code)
                {
                    this.OnReceiveFlow((Flow)command);
                }
                else
                {
                    this.OnReceiveLinkFrame(frame);
                }
            }
            catch (Exception exception) when(!Fx.IsFatal(exception))
            {
                AmqpTrace.Provider.AmqpLogError(this, "ProcessFrame", exception);
                this.SafeClose(exception);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Closes the session.
        /// </summary>
        /// <returns>True if the session is closed; false if close is pending.</returns>
        /// <remarks>All links in the session are also closed.</remarks>
        protected override bool CloseInternal()
        {
            if (this.State == AmqpObjectState.OpenReceived)
            {
                this.SendBegin();
            }

            this.CloseLinks(!this.LinkFrameAllowed());
            AmqpDebug.Dump(this);
            AmqpObjectState state = this.SendEnd();

            return(state == AmqpObjectState.End);
        }
Esempio n. 3
0
 /// <summary>
 /// Aborts the session object. All links in the session are aborted.
 /// </summary>
 protected override void AbortInternal()
 {
     this.CloseLinks(true);
     AmqpDebug.Dump(this);
 }
Esempio n. 4
0
 internal void SendCommand(Performative command, ByteBuffer payload)
 {
     AmqpDebug.Log(this, true, command);
     this.connection.SendCommand(command, this.LocalChannel, payload);
 }
Esempio n. 5
0
 public void SendCommand(Performative command, ArraySegment <byte>[] payload)
 {
     AmqpDebug.Log(this, true, command);
     this.connection.SendCommand(command, this.LocalChannel, payload);
 }