TransportClient Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. device. TransportClient
- com.
public class TransportClient
Note
This class has been deprecated. This client has been replaced with MultiplexingClient since this client does not support adding or removing devices once the connection has been established. MultiplexingClient allows for adding and removing of devices from multiplexed connections before or after opening the connection.
The public-facing API. Allows user to create a transport client abstracton object to use it for multiple devices to connect to an IoT Hub using the same connection (multiplexing). Handle to register devices to transport client and open / closeNow the connection.
The multiplexed connection is supported with AMQPS / AMQPS_WS protocols.
Field Summary
Modifier and Type | Field and Description |
---|---|
static long | RECEIVE_PERIOD_MILLIS_AMQPS |
static long | SEND_PERIOD_MILLIS |
Constructor Summary
Constructor | Description |
---|---|
TransportClient(IotHubClientProtocol protocol) |
Constructor that takes a protocol as an argument. |
Method Summary
Modifier and Type | Method and Description |
---|---|
void |
closeNow()
Completes all current outstanding requests and closes the IoT Hub client. |
void |
open()
Creates a deviceIO and sets it to all the device client. |
void |
setRetryPolicy(RetryPolicy retryPolicy)
Sets the given retry policy on the underlying transport Sets the given retry policy on the underlying transport See more details about the default retry policy and about using custom retry policies here |
void |
setSendInterval(long newIntervalInMilliseconds)
Sets the given send interval on the underlying device IO |
Methods inherited from java.lang.Object
Field Details
RECEIVE_PERIOD_MILLIS_AMQPS
public static long RECEIVE_PERIOD_MILLIS_AMQPS
SEND_PERIOD_MILLIS
public static long SEND_PERIOD_MILLIS
Constructor Details
TransportClient
public TransportClient(IotHubClientProtocol protocol)
Constructor that takes a protocol as an argument.
Parameters:
Method Details
closeNow
public void closeNow()
Completes all current outstanding requests and closes the IoT Hub client. Must be called to terminate the background thread that is sending data to IoT Hub. After closeNow()
is called, the IoT Hub client is no longer usable. If the client is already closed, the function shall do nothing.
Throws:
open
public void open()
Creates a deviceIO and sets it to all the device client. Verifies all device client's SAS tokens and renew them if it is necessary. Opens the transport client connection.
Throws:
setRetryPolicy
public void setRetryPolicy(RetryPolicy retryPolicy)
Sets the given retry policy on the underlying transport Sets the given retry policy on the underlying transport See more details about the default retry policy and about using custom retry policies here
Parameters:
setSendInterval
public void setSendInterval(long newIntervalInMilliseconds)
Sets the given send interval on the underlying device IO
Parameters:
Throws:
Applies to
Azure SDK for Java