Skip to content

Commit

Permalink
* NEW [bridge] support multi-streaming of QUIC
Browse files Browse the repository at this point in the history
Signed-off-by: jaylin <jaylin@emqx.io>
  • Loading branch information
JaylinYu authored and RanMaoyi committed Sep 22, 2023
1 parent 49249d6 commit 9c554fd
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions nanomq/bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,9 @@ bridge_quic_connect_cb(nng_pipe p, nng_pipe_ev ev, void *arg)
nng_mqtt_topic_qos_array_create(1);
nng_mqtt_topic_qos_array_set(topic_qos, 0,
param->config->sub_list[i]->remote_topic,
param->config->sub_list[i]->qos, 1, 0, 0);
param->config->sub_list[i]->qos, 1,
param->config->sub_list[i]->retain_as_published,
param->config->sub_list[i]->retain_handling);
log_info("Quic bridge client subscribe to "
"topic (QoS %d)%s.",
param->config->sub_list[i]->qos,
Expand Down Expand Up @@ -865,9 +867,12 @@ bridge_quic_client(nng_socket *sock, conf *config, conf_bridge_node *node, bridg
// set backoff param to 24s
nng_duration duration = 240000;
nng_dialer_set(dialer, NNG_OPT_MQTT_RECONNECT_BACKOFF_MAX, &duration, sizeof(nng_duration));
// nng_dialer_set_bool(dialer, NNG_OPT_QUIC_ENABLE_0RTT, true);
// nng_dialer_set_bool(dialer, NNG_OPT_QUIC_ENABLE_MULTISTREAM, true);

nng_dialer_set_bool(dialer, NNG_OPT_QUIC_ENABLE_0RTT, true);
if (node->multi_stream) {
//better remove the option from dialer
nng_dialer_set_bool(dialer, NNG_OPT_QUIC_ENABLE_MULTISTREAM, true);
nng_socket_set_bool(*sock, NNG_OPT_QUIC_ENABLE_MULTISTREAM, true);
}
bridge_arg->client = nng_mqtt_client_alloc(*sock, &send_callback, true);

// create a CONNECT message
Expand Down

0 comments on commit 9c554fd

Please sign in to comment.