mirror of
https://github.com/de2tla2f/pymaster.git
synced 2024-11-30 14:51:28 +00:00
add IPv6 support
This commit is contained in:
parent
ba2acb1f71
commit
39df7f1995
|
@ -19,6 +19,9 @@ MAX_SERVERS_FOR_IP = 14
|
|||
class PyMaster:
|
||||
def __init__(self, ip, port):
|
||||
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.bind((ip, port))
|
||||
|
||||
|
|
Loading…
Reference in a new issue