点击或拖拽改变大小

MqttConnectionOptionsKeepAlivePeriod 属性

设置的参数,最小单位为1s,当超过设置的时间间隔没有发送数据的时候,必须发送PINGREQ报文,否则服务器认定为掉线。
The minimum unit of the set parameter is 1s. When no data is sent beyond the set time interval, the PINGREQ message must be sent, otherwise the server considers it to be offline.

命名空间:  HslCommunication.MQTT
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:12.0.0.0 (12.0.0.0)
语法
public TimeSpan KeepAlivePeriod { get; set; }

属性值

类型:TimeSpan
备注
保持连接(Keep Alive)是一个以秒为单位的时间间隔,表示为一个16位的字,它是指在客户端传输完成一个控制报文的时刻到发送下一个报文的时刻, 两者之间允许空闲的最大时间间隔。客户端负责保证控制报文发送的时间间隔不超过保持连接的值。如果没有任何其它的控制报文可以发送, 客户端必须发送一个PINGREQ报文,详细参见 [MQTT-3.1.2-23]
参见