MqttClientUnSubscribeMessage 方法 (String) |
取消订阅多个主题信息,取消之后,当前的订阅数据就不在接收到,除非服务器强制推送。
Unsubscribe from multiple topic information. After cancellation, the current subscription data will not be received unless the server forces it to push it.
命名空间:
HslCommunication.MQTT
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public OperateResult UnSubscribeMessage(
string[] topics
)
Public Function UnSubscribeMessage (
topics As String()
) As OperateResult
public:
OperateResult^ UnSubscribeMessage(
array<String^>^ topics
)
member UnSubscribeMessage :
topics : string[] -> OperateResult
参数
- topics
- 类型:SystemString
主题信息
返回值
类型:
OperateResult取消订阅结果
示例
参照
MqttClient 的示例说明。
MqttClient mqttClient = new MqttClient( new MqttConnectionOptions( )
{
ClientId = "ABC",
IpAddress = "127.0.0.1",
} );
HslCommunication.OperateResult sub = mqttClient.UnSubscribeMessage( "A" );
if (sub.IsSuccess)
{
}
else
{
}
参见