ServiceClient 的用例?

Use-case of the ServiceClient?

ServiceClient 的用例是 send messages to devices 吗?

ServiceClient 仅支持 amqp 消息。 Azure 设备命名空间的文档说 "Transport types supported by ServiceClient - Amqp and Amqp over WebSocket only"。在代码中,TransportType 仅公开 Amqp。以后会改吗?

如果ServiceClient用于C2D消息,为什么在这个answer中写成"For ServiceClient, you need Azure IoT Hub connection string, not device connection string"?

如果我们持有创建的 ServiceClient 对象(或注册表管理器)的引用,性能影响和资源利用率是多少?

情况下有什么影响

  1. 我们什么时候打开关闭连接?

  2. 我们什么时候打开连接?

Is the use-case of the ServiceClient to send messages to devices?

是的。您需要使用 ServiceClient 发送 C2D 消息。

ServiceClient supports only amqp messages. Documentation for Azure Devices namespace says "Transport types supported by ServiceClient - Amqp and Amqp over WebSocket only". In code the TransportType exposes only Amqp. Would it be changed in the future?

以后的打算可以参考this guide提问

If the ServiceClient is been used for C2D messages, why in this answer, is written that "For ServiceClient, you need Azure IoT Hub connection string, not device connection string"?

设备连接字符串:基于 API 调用中使用的主键的连接字符串,允许设备与 Iot Hub 通信。它允许您接收 C2D 消息,而不是发送 C2D 消息。 IoT 中心 exposes its functionality to various actors,例如按设备和服务。

What is the performance's impact and resources' utilization, if we hold a reference of the created ServiceClient object (or the Registry Manager)?

您可以查看 IoT Hub throttling and you and IoT Hub quotas and throttling 了解更多详情。