feat(quic): quic conn idle_timeout default 1min

This commit is contained in:
William Yang 2021-06-16 15:08:56 +02:00
parent 4e2e2d5635
commit b4a9d663ae
2 changed files with 6 additions and 5 deletions

View File

@ -147,17 +147,17 @@ start_listener(quic, ListenOn, Options) ->
quicer_nif:open_lib(), quicer_nif:open_lib(),
quicer_nif:reg_open(), quicer_nif:reg_open(),
SSLOpts = proplists:get_value(ssl_options, Options), SSLOpts = proplists:get_value(ssl_options, Options),
DefAcceptors = erlang:system_info(schedulers_online) * 8,
ListenOpts = [ {cert, proplists:get_value(certfile, SSLOpts)} ListenOpts = [ {cert, proplists:get_value(certfile, SSLOpts)}
, {key, proplists:get_value(keyfile, SSLOpts)} , {key, proplists:get_value(keyfile, SSLOpts)}
, {alpn, ["mqtt"]} , {alpn, ["mqtt"]}
, {peer_unidi_stream_count, 1} , {conn_acceptors, proplists:get_value(acceptors, Options, DefAcceptors)}
, {peer_bidi_stream_count, 10} , {idle_timeout_ms, proplists:get_value(idle_timeout, Options, 60000)}
, {conn_acceptors, 32}
], ],
ConnectionOpts = [ {conn_callback, emqx_quic_connection} ConnectionOpts = [ {conn_callback, emqx_quic_connection}
, {idle_timeout_ms, 5000}
, {peer_unidi_stream_count, 1} , {peer_unidi_stream_count, 1}
, {peer_bidi_stream_count, 10}], , {peer_bidi_stream_count, 10}
],
StreamOpts = [], StreamOpts = [],
quicer:start_listener('mqtt:quic', ListenOn, {ListenOpts, ConnectionOpts, StreamOpts}). quicer:start_listener('mqtt:quic', ListenOn, {ListenOpts, ConnectionOpts, StreamOpts}).

View File

@ -382,6 +382,7 @@ fields("quic_listener_settings") ->
[ {"certfile", t(string(), undefined, undefined)} [ {"certfile", t(string(), undefined, undefined)}
, {"keyfile", t(string(), undefined, undefined)} , {"keyfile", t(string(), undefined, undefined)}
, {"ciphers", t(comma_separated_list(), undefined, "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_CHACHA20_POLY1305_SHA256")} , {"ciphers", t(comma_separated_list(), undefined, "TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_CHACHA20_POLY1305_SHA256")}
, {"idle_timeout", t(duration(), undefined, 60000)}
| fields("listener_settings")], | fields("listener_settings")],
Unsupported); Unsupported);