test quic

This commit is contained in:
anlicheng 2026-02-11 15:51:35 +08:00
parent eb015f1a67
commit e7af8a6019
2 changed files with 23 additions and 1 deletions

View File

@ -41,7 +41,7 @@ start_link() ->
init([]) -> init([]) ->
SupFlags = #{strategy => one_for_one, intensity => 1000, period => 3600}, SupFlags = #{strategy => one_for_one, intensity => 1000, period => 3600},
{ok, NetworkIds} = sdlan_api:get_all_networks(), {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)), set_network_bind(length(Specs)),
@ -110,6 +110,8 @@ child_spec(Id) when is_integer(Id) ->
modules => ['sdlan_network'] modules => ['sdlan_network']
}. }.
set_network_bind(0) ->
ok;
set_network_bind(Count) when is_integer(Count) -> set_network_bind(Count) when is_integer(Count) ->
{ok, BindWidth} = application:get_env(sdlan, band_width), {ok, BindWidth} = application:get_env(sdlan, band_width),
NetworkBindWidth = BindWidth div Count, NetworkBindWidth = BindWidth div Count,

View File

@ -0,0 +1,20 @@
%%%-------------------------------------------------------------------
%%% @author anlicheng
%%% @copyright (C) 2026, <COMPANY>
%%% @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).