ققنوس
ققنوس

Reputation: 15

ipv6 socket_programming python

i am trying to run this simple code to make client - server connection this is server_side :

   from socket import *
   s = socket(AF_INET6 , SOCK_STREAM  , 0)
   s.bind(("127.0.0.1" , 1234  , 0 , 0))

but i got error

what should i do ? thanks.

Upvotes: 0

Views: 110

Answers (1)

Jonathon Reinhart
Jonathon Reinhart

Reputation: 137398

127.0.0.1 is an IPv4 address. It is not valid for AF_INET6.

Try

s.bind(("::1" , 1234))

Upvotes: 1

Related Questions