diff --git a/iothub/device/src/DeviceClient.cs b/iothub/device/src/DeviceClient.cs index d6179291ce..70a15c7e62 100644 --- a/iothub/device/src/DeviceClient.cs +++ b/iothub/device/src/DeviceClient.cs @@ -4,8 +4,12 @@ using System; using System.Collections.Generic; using System.IO; +using System.Net.Sockets; +using System.Net.WebSockets; using System.Threading; using System.Threading.Tasks; +using DotNetty.Transport.Channels; +using Microsoft.Azure.Devices.Client.Exceptions; using Microsoft.Azure.Devices.Client.Transport; using Microsoft.Azure.Devices.Shared; @@ -475,6 +479,22 @@ public void SetRetryPolicy(IRetryPolicy retryPolicy) /// Sends an event to a hub /// /// The message to send. Should be disposed after sending. + /// Thrown when a required parameter is null. + /// Thrown if the service does not respond to the request within the timeout specified for the operation. + /// The timeout values are largely transport protocol specific. Check the corresponding transport settings to see if they can be configured. + /// The operation timeout for the client can be set using . + /// Thrown if the client encounters a transient retryable exception. + /// Thrown if a socket error occurs. + /// Thrown if an error occurs when performing an operation on a WebSocket connection. + /// Thrown if an I/O error occurs. + /// Thrown if the MQTT transport layer closes unexpectedly. + /// Thrown if an error occurs when communicating with IoT Hub service. + /// If is set to true then it is a transient exception. + /// If is set to false then it is a non-transient exception. + /// + /// In case of a transient issue, retrying the operation should work. In case of a non-transient issue, inspect the error details and take steps accordingly. + /// Please note that the list of exceptions is not exhaustive. + /// /// The task to await public Task SendEventAsync(Message message) => InternalClient.SendEventAsync(message); @@ -483,7 +503,22 @@ public void SetRetryPolicy(IRetryPolicy retryPolicy) /// /// The message to send. Should be disposed after sending. /// A cancellation token to cancel the operation. - /// Thrown when the operation has been canceled. + /// Thrown when a required parameter is null. + /// Thrown if the service does not respond to the request before the expiration of the passed . + /// If a cancellation token is not supplied to the operation call, a cancellation token with an expiration time of 4 minutes is used. + /// + /// Thrown if the client encounters a transient retryable exception. + /// Thrown if a socket error occurs. + /// Thrown if an error occurs when performing an operation on a WebSocket connection. + /// Thrown if an I/O error occurs. + /// Thrown if the MQTT transport layer closes unexpectedly. + /// Thrown if an error occurs when communicating with IoT Hub service. + /// If is set to true then it is a transient exception. + /// If is set to false then it is a non-transient exception. + /// + /// In case of a transient issue, retrying the operation should work. In case of a non-transient issue, inspect the error details and take steps accordingly. + /// Please note that the list of exceptions is not exhaustive. + /// /// The task to await public Task SendEventAsync(Message message, CancellationToken cancellationToken) => InternalClient.SendEventAsync(message, cancellationToken); diff --git a/iothub/device/src/ModuleClient.cs b/iothub/device/src/ModuleClient.cs index 8970dd1f0d..687406ee23 100644 --- a/iothub/device/src/ModuleClient.cs +++ b/iothub/device/src/ModuleClient.cs @@ -4,14 +4,19 @@ using System; using System.Collections.Generic; using System.Globalization; +using System.IO; using System.Net; using System.Net.Http; using System.Net.Security; +using System.Net.Sockets; +using System.Net.WebSockets; using System.Security.Cryptography.X509Certificates; using System.Text; using System.Threading; using System.Threading.Tasks; +using DotNetty.Transport.Channels; using Microsoft.Azure.Devices.Client.Edge; +using Microsoft.Azure.Devices.Client.Exceptions; using Microsoft.Azure.Devices.Client.Extensions; using Microsoft.Azure.Devices.Client.Transport; using Microsoft.Azure.Devices.Shared; @@ -346,6 +351,22 @@ public void SetRetryPolicy(IRetryPolicy retryPolicy) /// Sends an event to IoT hub /// /// The message. + /// Thrown when a required parameter is null. + /// Thrown if the service does not respond to the request within the timeout specified for the operation. + /// The timeout values are largely transport protocol specific. Check the corresponding transport settings to see if they can be configured. + /// The operation timeout for the client can be set using . + /// Thrown if the client encounters a transient retryable exception. + /// Thrown if a socket error occurs. + /// Thrown if an error occurs when performing an operation on a WebSocket connection. + /// Thrown if an I/O error occurs. + /// Thrown if the MQTT transport layer closes unexpectedly. + /// Thrown if an error occurs when communicating with IoT Hub service. + /// If is set to true then it is a transient exception. + /// If is set to false then it is a non-transient exception. + /// + /// In case of a transient issue, retrying the operation should work. In case of a non-transient issue, inspect the error details and take steps accordingly. + /// Please note that the list of exceptions is not exhaustive. + /// /// The message containing the event public Task SendEventAsync(Message message) => InternalClient.SendEventAsync(message); @@ -354,7 +375,22 @@ public void SetRetryPolicy(IRetryPolicy retryPolicy) /// /// The message. /// A cancellation token to cancel the operation. - /// Thrown when the operation has been canceled. + /// Thrown when a required parameter is null. + /// Thrown if the service does not respond to the request before the expiration of the passed . + /// If a cancellation token is not supplied to the operation call, a cancellation token with an expiration time of 4 minutes is used. + /// + /// Thrown if the client encounters a transient retryable exception. + /// Thrown if a socket error occurs. + /// Thrown if an error occurs when performing an operation on a WebSocket connection. + /// Thrown if an I/O error occurs. + /// Thrown if the MQTT transport layer closes unexpectedly. + /// Thrown if an error occurs when communicating with IoT Hub service. + /// If is set to true then it is a transient exception. + /// If is set to false then it is a non-transient exception. + /// + /// In case of a transient issue, retrying the operation should work. In case of a non-transient issue, inspect the error details and take steps accordingly. + /// Please note that the list of exceptions is not exhaustive. + /// /// The message containing the event public Task SendEventAsync(Message message, CancellationToken cancellationToken) => InternalClient.SendEventAsync(message, cancellationToken); @@ -521,7 +557,22 @@ protected virtual void Dispose(bool disposing) /// /// The output target for sending the given message /// The message to send - /// Thrown when the operation has been canceled. + /// Thrown when a required parameter is null. + /// Thrown if the service does not respond to the request within the timeout specified for the operation. + /// The timeout values are largely transport protocol specific. Check the corresponding transport settings to see if they can be configured. + /// The operation timeout for the client can be set using . + /// Thrown if the client encounters a transient retryable exception. + /// Thrown if a socket error occurs. + /// Thrown if an error occurs when performing an operation on a WebSocket connection. + /// Thrown if an I/O error occurs. + /// Thrown if the MQTT transport layer closes unexpectedly. + /// Thrown if an error occurs when communicating with IoT Hub service. + /// If is set to true then it is a transient exception. + /// If is set to false then it is a non-transient exception. + /// + /// In case of a transient issue, retrying the operation should work. In case of a non-transient issue, inspect the error details and take steps accordingly. + /// Please note that the above list is not exhaustive. + /// /// The message containing the event public Task SendEventAsync(string outputName, Message message) => InternalClient.SendEventAsync(outputName, message); @@ -532,7 +583,22 @@ protected virtual void Dispose(bool disposing) /// The output target for sending the given message /// The message to send /// A cancellation token to cancel the operation. - /// Thrown when the operation has been canceled. + /// Thrown when a required parameter is null. + /// Thrown if the service does not respond to the request before the expiration of the passed . + /// If a cancellation token is not supplied to the operation call, a cancellation token with an expiration time of 4 minutes is used. + /// + /// Thrown if the client encounters a transient retryable exception. + /// Thrown if a socket error occurs. + /// Thrown if an error occurs when performing an operation on a WebSocket connection. + /// Thrown if an I/O error occurs. + /// Thrown if the MQTT transport layer closes unexpectedly. + /// Thrown if an error occurs when communicating with IoT Hub service. + /// If is set to true then it is a transient exception. + /// If is set to false then it is a non-transient exception. + /// + /// In case of a transient issue, retrying the operation should work. In case of a non-transient issue, inspect the error details and take steps accordingly. + /// Please note that the above list is not exhaustive. + /// /// The message containing the event public Task SendEventAsync(string outputName, Message message, CancellationToken cancellationToken) => InternalClient.SendEventAsync(outputName, message, cancellationToken);