protected override bool OnClose(Error error)
{
this.CancelPendingDeliveries(error);
lock (this.ThisLock)
{
if (this.state == State.End)
{
return true;
}
else if (this.state == State.BeginSent)
{
this.state = State.EndPipe;
}
else if (this.state == State.Opened)
{
this.state = State.EndSent;
}
else if (this.state == State.EndReceived)
{
this.state = State.End;
}
else
{
throw new AmqpException(ErrorCode.IllegalState,
Fx.Format(SRAmqp.AmqpIllegalOperationState, "Close", this.state));
}
this.SendEnd();
return this.state == State.End;
}
}