sdlan/src/test/test_ipv6_udp.erl
2026-04-16 21:00:46 +08:00

26 lines
676 B
Erlang

%%%-------------------------------------------------------------------
%%% @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">>).