title: Correct way of using gen_tcp:connect with IPv6 Address
body: <p>Does anyone know how to connect to ipv6 tcp server address. Following tried but does not work.</p>
  
  <pre><code>{ok, Socket} = gen_tcp:connect("2a01:488:67:1000:253d:cd31:0:1", 5000, [{active, false},inet6]).
  {error,enetunreach}
  </code></pre>
  
  <p>And this</p>
  
  <pre><code>{ok, Socket} = gen_tcp:connect("[2a01:488:67:1000:253d:cd31:0:1]", 5000, [{active, false},inet6]).
  {error,nxdomain}
  </code></pre>
  
  <p>The server is reachable over IPv4 though.</p>
  
  <p>Thanks.</p>