Beispiel #1
0
 void OnEnd(ushort remoteChannel, End end)
 {
     Session session = this.GetSession(this.remoteSessions, remoteChannel);
     if (session.OnEnd(end))
     {
         lock (this.ThisLock)
         {
             this.localSessions[session.Channel] = null;
             this.remoteSessions[remoteChannel] = null;
         }
     }
 }
Beispiel #2
0
        internal bool OnEnd(End end)
        {
            lock (this.ThisLock)
            {
                if (this.state == State.EndSent)
                {
                    this.state = State.End;
                }
                else if (this.state == State.Opened)
                {
                    this.SendEnd();
                    this.state = State.End;
                }
                else
                {
                    throw new AmqpException(ErrorCode.IllegalState,
                        Fx.Format(SRAmqp.AmqpIllegalOperationState, "OnEnd", this.state));
                }

                this.OnClose(end.Error);
                this.NotifyClosed(end.Error);
                return true;
            }
        }