Browse Source

add IPv6 support

v2
ghost 11 months ago
parent
commit
39df7f1995
  1. 3
      pymaster.py

3
pymaster.py

@ -19,6 +19,9 @@ MAX_SERVERS_FOR_IP = 14
class PyMaster: class PyMaster:
def __init__(self, ip, port): def __init__(self, ip, port):
self.serverList = [] self.serverList = []
if ':' in ip:
self.sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
else:
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.sock.bind((ip, port)) self.sock.bind((ip, port))

Loading…
Cancel
Save