共用方式為


MqttTransportSettings.KeepAliveInSeconds Property

Definition

The interval, in seconds, that the client establishes with the service, for sending protocol-level keep-alive pings. The default is 300 seconds.

public int KeepAliveInSeconds { get; set; }
member this.KeepAliveInSeconds : int with get, set
Public Property KeepAliveInSeconds As Integer

Property Value

Remarks

The client will send a ping request 4 times per keep-alive duration set. It will wait for 30 seconds for the ping response, else mark the connection as disconnected. Setting a very low keep-alive value can cause aggressive reconnects, and might not give the client enough time to establish a connection before disconnecting and reconnecting.

Applies to