Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. I am facing an issue with getsockname API of socket module. Following is the code I am using to get the ipv6 address of remote system.
  2. import socket
  3.  
  4. def checkit():
  5. s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
  6. s.connect(('10.10.10.10', 80))
  7. print "ipv6 addressn%s" % str(s.getsockname()[0])
  8.  
  9. checkit()
  10.  
  11. in Python 2.7.3
  12.  
  13. ipv6 address
  14. 2001:420:404a:2018:155d:30ea:c897:76e9
  15.  
  16. in Python 2.7.11
  17.  
  18. ipv6 address
  19. ::1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement