点击或拖拽改变大小

MqttServer.PublishTopicPayload 方法 (String,Byte[], Boolean, Func<MqttSession, Boolean>)

使用指定的规则向客户端发布主题及负载数据,可以根据会话的登录用户名,客户端ID信息进行筛选,例如只发布用户名admin的账户:( session ) => session.UserName == "admin"
Use the specified rules to publish topic and load data to the client, which can be filtered according to the session login user name and client ID information. For example, only the account with the user name admin is published: ( session ) => session.UserName == "admin"

命名空间:  HslCommunication.MQTT
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:12.3.0.0 (12.3.0.0)
语法
public void PublishTopicPayload(
	string topic,
	byte[] payload,
	bool retain,
	Func<MqttSession, bool> check
)

参数

topic
类型:System.String
主题
payload
类型:System.Byte[]
消息内容
retain
类型:System.Boolean
是否在服务器驻留
check
类型:System.Func<MqttSession, Boolean>
会话的检查委托
参见