keepAlivePeriod property
Keep alive period, seconds. The default is 0 which disables the keep alive mechanism. To enable the keep alive mechanism set this to a value greater than 0.
Implementation
int keepAlivePeriod = MqttConstants.defaultKeepAlive;