コード例 #1
0
        public async Task <AmqpIotOutcome> SendMethodResponseAsync(MethodResponseInternal methodResponse, TimeSpan timeout)
        {
            Logging.Enter(this, methodResponse, nameof(SendMethodResponseAsync));

            await EnableMethodsAsync(timeout).ConfigureAwait(false);

            Debug.Assert(_methodSendingLink != null);

            try
            {
                return(await _methodSendingLink.SendMethodResponseAsync(methodResponse, timeout).ConfigureAwait(false));
            }
            finally
            {
                Logging.Exit(this, methodResponse, nameof(SendMethodResponseAsync));
            }
        }
コード例 #2
0
        public async Task <AmqpIotOutcome> SendMethodResponseAsync(MethodResponseInternal methodResponse, CancellationToken cancellationToken)
        {
            if (Logging.IsEnabled)
            {
                Logging.Enter(this, methodResponse, nameof(SendMethodResponseAsync));
            }

            await EnableMethodsAsync(cancellationToken).ConfigureAwait(false);

            Debug.Assert(_methodSendingLink != null);

            try
            {
                return(await _methodSendingLink.SendMethodResponseAsync(methodResponse, cancellationToken).ConfigureAwait(false));
            }
            finally
            {
                if (Logging.IsEnabled)
                {
                    Logging.Exit(this, methodResponse, nameof(SendMethodResponseAsync));
                }
            }
        }