コード例 #1
0
ファイル: Connection.cs プロジェクト: kornys/amqpnetlite
 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;
         }
     }
 }
コード例 #2
0
ファイル: Session.cs プロジェクト: kornys/amqpnetlite
        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;
            }
        }