From e7af8a6019b5ae7e00802f1f60ee4a6ba62b93fc Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Wed, 11 Feb 2026 15:51:35 +0800 Subject: [PATCH] test quic --- apps/sdlan/src/sdlan_network_sup.erl | 4 +++- apps/sdlan/src/test/sdlan_quicer_test.erl | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 apps/sdlan/src/test/sdlan_quicer_test.erl diff --git a/apps/sdlan/src/sdlan_network_sup.erl b/apps/sdlan/src/sdlan_network_sup.erl index 5a39378..8dba1d7 100644 --- a/apps/sdlan/src/sdlan_network_sup.erl +++ b/apps/sdlan/src/sdlan_network_sup.erl @@ -41,7 +41,7 @@ start_link() -> init([]) -> SupFlags = #{strategy => one_for_one, intensity => 1000, period => 3600}, {ok, NetworkIds} = sdlan_api:get_all_networks(), - Specs = lists:map(fun child_spec/1, NetworkIds), + Specs = lists:map(fun child_spec/1, []), set_network_bind(length(Specs)), @@ -110,6 +110,8 @@ child_spec(Id) when is_integer(Id) -> modules => ['sdlan_network'] }. +set_network_bind(0) -> + ok; set_network_bind(Count) when is_integer(Count) -> {ok, BindWidth} = application:get_env(sdlan, band_width), NetworkBindWidth = BindWidth div Count, diff --git a/apps/sdlan/src/test/sdlan_quicer_test.erl b/apps/sdlan/src/test/sdlan_quicer_test.erl new file mode 100644 index 0000000..89c7928 --- /dev/null +++ b/apps/sdlan/src/test/sdlan_quicer_test.erl @@ -0,0 +1,20 @@ +%%%------------------------------------------------------------------- +%%% @author anlicheng +%%% @copyright (C) 2026, +%%% @doc +%%% +%%% @end +%%% Created : 11. 2月 2026 15:49 +%%%------------------------------------------------------------------- +-module(sdlan_quicer_test). +-author("anlicheng"). + +%% API +-export([test/0]). + +test() -> + {ok, Conn} = quicer:connect("http3.is", 443, [{alpn, ["h3"]}, + {verify, verify_peer}, + {peer_unidi_stream_count, 3}], 5000), + logger:debug("conn is: ~p", [Conn]), + quicer:shutdown_connection(Conn). \ No newline at end of file