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; } } }
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; } }
void SendDetach(Error error) { Detach detach = new Detach() { Handle = this.handle, Error = error, Closed = true }; this.session.SendCommand(detach); }
void OnDetach(Detach detach) { Link link = this.GetLink(detach.Handle); link.OnDetach(detach); }