remove debug
This commit is contained in:
parent
5f5effcd84
commit
c907a2f6b0
@ -80,13 +80,10 @@ handle_cast(_Request, State) ->
|
|||||||
{noreply, NewState :: #state{}, timeout() | hibernate} |
|
{noreply, NewState :: #state{}, timeout() | hibernate} |
|
||||||
{stop, Reason :: term(), NewState :: #state{}}.
|
{stop, Reason :: term(), NewState :: #state{}}.
|
||||||
handle_info({udp, Sock, Ip, Port, Body}, State = #state{socket = Sock}) ->
|
handle_info({udp, Sock, Ip, Port, Body}, State = #state{socket = Sock}) ->
|
||||||
logger:debug("[ipv6_assist_server] get request"),
|
|
||||||
maybe
|
maybe
|
||||||
ThrottleKey = {Ip, Port},
|
ThrottleKey = {Ip, Port},
|
||||||
ok ?= limit_check(ThrottleKey),
|
ok ?= limit_check(ThrottleKey),
|
||||||
logger:debug("[ipv6_assist_server] get request11"),
|
|
||||||
#'SDLV6AssistProbe'{pkt_id = PktId} ?= catch sdlan_pb:decode_msg(Body, 'SDLV6AssistProbe'),
|
#'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),
|
V6Bytes = sdlan_util:ipv6_to_bytes(Ip),
|
||||||
ReplyBin = sdlan_pb:encode_msg(#'SDLV6AssistProbeReply'{
|
ReplyBin = sdlan_pb:encode_msg(#'SDLV6AssistProbeReply'{
|
||||||
pkt_id = PktId,
|
pkt_id = PktId,
|
||||||
@ -95,7 +92,6 @@ handle_info({udp, Sock, Ip, Port, Body}, State = #state{socket = Sock}) ->
|
|||||||
port = Port
|
port = Port
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
logger:debug("[ipv6_assist_server] get request33"),
|
|
||||||
ok ?= gen_udp:send(Sock, Ip, Port, ReplyBin)
|
ok ?= gen_udp:send(Sock, Ip, Port, ReplyBin)
|
||||||
end,
|
end,
|
||||||
{noreply, State};
|
{noreply, State};
|
||||||
|
|||||||
26
src/test/test_ipv6_udp.erl
Normal file
26
src/test/test_ipv6_udp.erl
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
%%%-------------------------------------------------------------------
|
||||||
|
%%% @author anlicheng
|
||||||
|
%%% @copyright (C) 2026, <COMPANY>
|
||||||
|
%%% @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">>).
|
||||||
Loading…
x
Reference in New Issue
Block a user