void OnReceiveDetach(Detach detach) { if (detach.Error != null) { Utils.Trace(TraceLevel.Error, "{0}: Detach {1}", this, detach.Error); } StateTransition stateTransition; this.TransitState("R:DETACH", StateTransition.ReceiveClose, out stateTransition); if (stateTransition.To == AmqpObjectState.End) { this.CompleteClose(false, null); } else { if (detach.Error != null) { this.CompleteOpen(false, AmqpException.FromError(detach.Error)); } this.Close(); } }
void SendDetach() { this.TransitState("S:DETACH", StateTransition.SendClose); Detach detach = new Detach(); detach.Handle = this.LocalHandle; detach.Closed = true; Exception exception = this.TerminalException; if (exception != null) { detach.Error = AmqpError.FromException(exception); } this.Session.SendCommand(detach); }