From c907a2f6b07c0ba64e3739191f0794ffad3996ef Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Thu, 16 Apr 2026 21:00:46 +0800 Subject: [PATCH] remove debug --- src/ipv6_assist/ipv6_assist_server.erl | 4 ---- src/test/test_ipv6_udp.erl | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 src/test/test_ipv6_udp.erl diff --git a/src/ipv6_assist/ipv6_assist_server.erl b/src/ipv6_assist/ipv6_assist_server.erl index 0387528..75c2a5f 100644 --- a/src/ipv6_assist/ipv6_assist_server.erl +++ b/src/ipv6_assist/ipv6_assist_server.erl @@ -80,13 +80,10 @@ handle_cast(_Request, State) -> {noreply, NewState :: #state{}, timeout() | hibernate} | {stop, Reason :: term(), NewState :: #state{}}. handle_info({udp, Sock, Ip, Port, Body}, State = #state{socket = Sock}) -> - logger:debug("[ipv6_assist_server] get request"), maybe ThrottleKey = {Ip, Port}, ok ?= limit_check(ThrottleKey), - logger:debug("[ipv6_assist_server] get request11"), #'SDLV6AssistProbe'{pkt_id = PktId} ?= catch sdlan_pb:decode_msg(Body, 'SDLV6AssistProbe'), - logger:debug("[ipv6_assist_server] get request22"), V6Bytes = sdlan_util:ipv6_to_bytes(Ip), ReplyBin = sdlan_pb:encode_msg(#'SDLV6AssistProbeReply'{ pkt_id = PktId, @@ -95,7 +92,6 @@ handle_info({udp, Sock, Ip, Port, Body}, State = #state{socket = Sock}) -> port = Port } }), - logger:debug("[ipv6_assist_server] get request33"), ok ?= gen_udp:send(Sock, Ip, Port, ReplyBin) end, {noreply, State}; diff --git a/src/test/test_ipv6_udp.erl b/src/test/test_ipv6_udp.erl new file mode 100644 index 0000000..7930056 --- /dev/null +++ b/src/test/test_ipv6_udp.erl @@ -0,0 +1,26 @@ +%%%------------------------------------------------------------------- +%%% @author anlicheng +%%% @copyright (C) 2026, +%%% @doc +%%% +%%% @end +%%% Created : 16. 4月 2026 20:53 +%%%------------------------------------------------------------------- +-module(test_ipv6_udp). +-author("anlicheng"). + +%% API +-export([test/0]). + +test() -> + Opts = [ + binary, + inet6, + {reuseaddr, true}, + {reuseport, true}, + {active, true}, + {recbuf, 5 * 1024 * 1024}, + {sndbuf, 5 * 1024 * 1024} + ], + {ok, Socket} = gen_udp:open(0, Opts), + ok = gen_udp:send(Socket, "2408:4005:318:4900:164a:b5c6:9023:ca8d", 1367, <<"hello world">>). \ No newline at end of file