Microsoft.Azure.Amqp.DuplexAmqpLink.CloseInternal C# (CSharp) Method

CloseInternal() protected method

protected CloseInternal ( ) : bool
return bool
        protected override bool CloseInternal()
        {
            if (this.TerminalException != null)
            {
                this.sender.SafeClose(this.TerminalException);
                this.receiver.SafeClose(this.TerminalException);
                return true;
            }

            IAsyncResult senderResult = this.sender.BeginClose(this.DefaultCloseTimeout, onSenderClose, this);
            IAsyncResult receiverResult = this.receiver.BeginClose(this.DefaultCloseTimeout, onReceiverClose, this);
            return senderResult.CompletedSynchronously && receiverResult.CompletedSynchronously;
        }