public async Task <AmqpIotOutcome> SendMessageAsync(Message message, TimeSpan timeout) { Logging.Enter(this, message, timeout, nameof(SendMessageAsync)); await EnsureSessionIsOpenAsync(timeout).ConfigureAwait(false); try { Debug.Assert(_messageSendingLink != null); return(await _messageSendingLink.SendMessageAsync(message, timeout).ConfigureAwait(false)); } finally { Logging.Exit(this, message, timeout, nameof(SendMessageAsync)); } }
public async Task <AmqpIotOutcome> SendMessageAsync(Message message, CancellationToken cancellationToken) { if (Logging.IsEnabled) { Logging.Enter(this, message, nameof(SendMessageAsync)); } await EnsureSessionIsOpenAsync(cancellationToken).ConfigureAwait(false); try { Debug.Assert(_messageSendingLink != null); return(await _messageSendingLink.SendMessageAsync(message, cancellationToken).ConfigureAwait(false)); } finally { if (Logging.IsEnabled) { Logging.Exit(this, message, nameof(SendMessageAsync)); } } }