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