示例#1
0
 void OnDetach(Detach detach)
 {
     Link link = this.GetLink(detach.Handle);
     if (link.OnDetach(detach))
     {
         lock (this.ThisLock)
         {
             this.localLinks[link.Handle] = null;
             this.remoteLinks[detach.Handle] = null;
         }
     }
 }
示例#2
0
        internal bool OnDetach(Detach detach)
        {
            lock (this.ThisLock)
            {
                if (this.state == LinkState.DetachSent)
                {
                    this.state = LinkState.End;
                }
                else if (this.state == LinkState.Attached)
                {
                    this.SendDetach(null);
                    this.state = LinkState.End;
                }
                else
                {
                    throw new AmqpException(ErrorCode.IllegalState,
                        Fx.Format(SRAmqp.AmqpIllegalOperationState, "OnDetach", this.state));
                }

                this.OnClose(detach.Error);
                this.NotifyClosed(detach.Error);
                return true;
            }
        }
示例#3
0
 void SendDetach(Error error)
 {
     Detach detach = new Detach() { Handle = this.handle, Error = error, Closed = true };
     this.session.SendCommand(detach);
 }
示例#4
0
 void OnDetach(Detach detach)
 {
     Link link = this.GetLink(detach.Handle);
     link.OnDetach(detach);
 }