Example #1
0
        private void HandleDetachFrame(Detach detach)
        {
            if (State != LinkStateEnum.ATTACHED && State != LinkStateEnum.DETACH_SENT && State != LinkStateEnum.DESTROYED)
                throw new AmqpException(ErrorCode.IllegalState, $"Received Detach frame but link state is {State.ToString()}.");

            if (detach.Error != null)
            {
                trace.Debug("Detaching Link {0} Due to Error From Remote Link Endpoint: '{1}'", LocalHandle, detach.Error);
            }

            if (State == LinkStateEnum.ATTACHED)
                State = LinkStateEnum.DETACH_RECEIVED;

            DetachLink(null, destoryLink: detach.Closed);
        }
Example #2
0
        private void InterceptDetachFrame(Detach detach)
        {
            if (!State.CanReceiveFrames())
                throw new AmqpException(ErrorCode.IllegalState, $"Received Detach frame but session state is {State.ToString()}.");
            if (State == SessionStateEnum.DISCARDING)
                return;

            GetRemoteLink(detach.Handle).HandleLinkFrame(detach);
        }