Modify server to use IPv6

This commit is contained in:
Camden Dixie O'Brien 2025-02-22 19:53:37 +00:00
parent bf5f517e85
commit 5ae2b992ef

View File

@ -22,7 +22,7 @@ child_spec(Port) ->
modules => [?MODULE]}. modules => [?MODULE]}.
init([Port]) -> init([Port]) ->
{ok, Socket} = gen_tcp:listen(Port, [binary, {active, true}]), {ok, Socket} = gen_tcp:listen(Port, [binary, inet6, {active, true}]),
Pid = spawn_link(fun() -> acceptor_loop(Socket) end), Pid = spawn_link(fun() -> acceptor_loop(Socket) end),
{ok, #state{socket = Socket, acceptor = Pid}}. {ok, #state{socket = Socket, acceptor = Pid}}.