DeviceClient.SendEventAsync Method

Definition

Overloads

SendEventAsync(Message)

Sends an event to a hub

SendEventAsync(Message, CancellationToken)

Sends an event to a hub

SendEventAsync(Message)

Sends an event to a hub

public System.Threading.Tasks.Task SendEventAsync (Microsoft.Azure.Devices.Client.Message message);
member this.SendEventAsync : Microsoft.Azure.Devices.Client.Message -> System.Threading.Tasks.Task
Public Function SendEventAsync (message As Message) As Task

Parameters

message
Message

The message to send. Should be disposed after sending.

Returns

System.Threading.Tasks.Task

The task to await

Applies to

SendEventAsync(Message, CancellationToken)

Sends an event to a hub

public System.Threading.Tasks.Task SendEventAsync (Microsoft.Azure.Devices.Client.Message message, System.Threading.CancellationToken cancellationToken);
member this.SendEventAsync : Microsoft.Azure.Devices.Client.Message * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function SendEventAsync (message As Message, cancellationToken As CancellationToken) As Task

Parameters

message
Message

The message to send. Should be disposed after sending.

cancellationToken
System.Threading.CancellationToken

A cancellation token to cancel the operation.

Returns

System.Threading.Tasks.Task

The task to await

Exceptions

System.OperationCanceledException

Thrown when the operation has been canceled.

Applies to