title: Establishing an IPv6 connection using sockets in python
body: <p>I am trying to run this very basic socket example:</p>
  
  <pre><code>import socket
  host = 'ipv6hostnamegoeshere'
  port=9091
  
  ourSocket = socket.socket(socket.AF_INET6, socket.SOCK_STREAM, 0)
  ourSocket.connect((host, port))
  </code></pre>
  
  <p>Yet, I get the error:</p>
  
  <pre><code>    ourSocket.connect((host, port))
    File "&lt;string&gt;", line 1, in connect
  socket.error: [Errno 22] Invalid argument
  </code></pre>
  
  <p>The boolean has_ipv6 returns true. Any help?</p>