title: ipv6 python sockets not working
body: <p>I have a simple client server program and the server side works but for some reason I can't get the the client to interact to the server.  I am able to launch the server and use <code>nc -u ::1 50007</code> and connect to it and it works as intended.  </p>
  
  <p>Server code:</p>
  
  <pre><code>import socket
  import sys
  
  
  
  def main():
      HOST = '::1'
      PORT = 50007
      res = socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, socket.AI_PASSIVE)
      af, socktype, proto, canonname, sa = res[0]
      try:
          s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
          s.bind(sa)
          while True:
              data, addr = s.recvfrom(1024)
              if not data:
                  break
              print 'server received %r from %r' % (data, addr)
              s.sendto(data, addr)
          s.close()
      except socket.error, msg:
          print msg
  
  
  
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p>Client code:</p>
  
  <pre><code>import socket
  import sys
  
  def main():
      HOST = '2015:cc00:bb00:aa00::2'   
      PORT = 50007              
      res = socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM)
      af, socktype, proto, canonname, sa = res[0]
      try:
          s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
          s.connect(sa)
          s.send('Hello, world')
          data, addr = s.recvfrom(1024)
          s.close()
          print 'Received', repr(data)
      except socket.error as e:
          print e
  
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p>I am able to ping from client to server, but I can't <code>nc -u 2015:cc00:bb00:aa00::2 50007</code> either.  When I run the client code I get a connection refused error. Not sure why it is not connecting, any ideas?</p>