Skip to content

Commit

Permalink
chagne quic keepalive less than idle_timeout, current config will cau…
Browse files Browse the repository at this point in the history
…se connection_idle and reconnect
  • Loading branch information
donghui1277 authored and wanghaEMQ committed Aug 8, 2024
1 parent b3402be commit 52e79ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions demo/quic_mqtt/quic_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ conf_quic config_user = {
},
.multi_stream = false,
.qos_first = false,
.qkeepalive = 30,
.qkeepalive = 10,
.qconnect_timeout = 60,
.qdiscon_timeout = 30,
.qidle_timeout = 30,
Expand All @@ -84,7 +84,7 @@ mqtt_msg_compose(int type, int qos, char *topic, char *payload)
nng_mqtt_msg_set_packet_type(msg, NNG_MQTT_CONNECT);

nng_mqtt_msg_set_connect_proto_version(msg, 4);
nng_mqtt_msg_set_connect_keep_alive(msg, 30);
nng_mqtt_msg_set_connect_keep_alive(msg, 10);
nng_mqtt_msg_set_connect_clean_session(msg, true);
} else if (type == SUB) {
nng_mqtt_msg_set_packet_type(msg, NNG_MQTT_SUBSCRIBE);
Expand Down
4 changes: 2 additions & 2 deletions demo/quic_mqttv5/quic_client_v5.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ conf_quic config_user = {
},
.multi_stream = false,
.qos_first = false,
.qkeepalive = 30,
.qkeepalive = 10,
.qconnect_timeout = 60,
.qdiscon_timeout = 30,
.qidle_timeout = 30,
Expand Down Expand Up @@ -145,7 +145,7 @@ compose_connect()
nng_mqtt_msg_set_connect_property(msg, p);

nng_mqtt_msg_set_connect_proto_version(msg, MQTT_PROTOCOL_VERSION_v5);
nng_mqtt_msg_set_connect_keep_alive(msg, 30);
nng_mqtt_msg_set_connect_keep_alive(msg, 10);
nng_mqtt_msg_set_connect_clean_session(msg, true);

return msg;
Expand Down

0 comments on commit 52e79ed

Please sign in to comment.