Modify server to use IPv6
This commit is contained in:
1 parent
bf5f517e85
commit
5ae2b992ef
1 file changed
+1
-1
@@ -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}}.
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user