Change keep alive ratio to 1.5 from 0.75

Fixes: ARTEMIS-397

From mqtt specs:

“If the Keep Alive value is non-zero and the Server does not receive a
Control Packet from the Client within one and a half times the Keep
Alive time period, it MUST disconnect the Network Connection to the
Client as if the network had failed [MQTT-3.1.2-24]. “
This commit is contained in:
Diego Bes 2016-04-29 08:43:25 -07:00 committed by Martyn Taylor
parent 7d0d779990
commit 75a4e78948
1 changed files with 1 additions and 1 deletions

View File

@ -156,7 +156,7 @@ public class MQTTProtocolHandler extends ChannelInboundHandlerAdapter {
*/
void handleConnect(MqttConnectMessage connect, ChannelHandlerContext ctx) throws Exception {
this.ctx = ctx;
connectionEntry.ttl = connect.variableHeader().keepAliveTimeSeconds() * 750;
connectionEntry.ttl = connect.variableHeader().keepAliveTimeSeconds() * 1500;
String clientId = connect.payload().clientIdentifier();
session.getConnectionManager().connect(clientId, connect.payload().userName(), connect.payload().password(), connect.variableHeader().isWillFlag(), connect.payload().willMessage(), connect.payload().willTopic(), connect.variableHeader().isWillRetain(), connect.variableHeader().willQos(), connect.variableHeader().isCleanSession());