使用gen_tcp的正确方法:连接IPv6地址
问题描述:
有谁知道如何连接到ipv6的tcp服务器地址。以下尝试但不起作用。使用gen_tcp的正确方法:连接IPv6地址
{ok, Socket} = gen_tcp:connect("2a01:488:67:1000:253d:cd31:0:1", 5000, [{active, false},inet6]).
{error,enetunreach}
这
{ok, Socket} = gen_tcp:connect("[2a01:488:67:1000:253d:cd31:0:1]", 5000, [{active, false},inet6]).
{error,nxdomain}
服务器通过IPv4可达虽然。
谢谢。
Erlang之外的服务器是否可以通过IPv6访问?当你说“通过IPv4可达”时,你的意思是在Erlang吗?你的意思是在'gen_tcp:connect'调用中使用(例如)“192.168.1.1”还是其他的? –
是由erlang在ipv4中。 – user3404572
固定。请忽略这是ipv6地址的端口阻塞。谢谢 – user3404572