DeviceClient.ReceiveAsync Method

Definition

Overloads

ReceiveAsync()

Receive a message from the device queue using the default timeout.

ReceiveAsync(CancellationToken)

Receive a message from the device queue using the cancellation token.

ReceiveAsync(TimeSpan)

Receive a message from the device queue with the specified timeout

ReceiveAsync()

Receive a message from the device queue using the default timeout.

public System.Threading.Tasks.Task<Microsoft.Azure.Devices.Client.Message> ReceiveAsync ();
member this.ReceiveAsync : unit -> System.Threading.Tasks.Task<Microsoft.Azure.Devices.Client.Message>
Public Function ReceiveAsync () As Task(Of Message)

Returns

The receive message or null if there was no message until the default timeout

ReceiveAsync(CancellationToken)

Receive a message from the device queue using the cancellation token.

public System.Threading.Tasks.Task<Microsoft.Azure.Devices.Client.Message> ReceiveAsync (System.Threading.CancellationToken cancellationToken);
member this.ReceiveAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Devices.Client.Message>

Parameters

cancellationToken
CancellationToken

A cancellation token to cancel the operation.

Returns

The receive message or null if there was no message until CancellationToken Expired

Exceptions

Thrown when the operation has been canceled.

ReceiveAsync(TimeSpan)

Receive a message from the device queue with the specified timeout

public System.Threading.Tasks.Task<Microsoft.Azure.Devices.Client.Message> ReceiveAsync (TimeSpan timeout);
member this.ReceiveAsync : TimeSpan -> System.Threading.Tasks.Task<Microsoft.Azure.Devices.Client.Message>
Public Function ReceiveAsync (timeout As TimeSpan) As Task(Of Message)

Parameters

timeout
TimeSpan

Returns

The receive message or null if there was no message until the specified time has elapsed

Applies to