def __init__(self, destination, routing_specifications, options):
LoadbalancerControl.__init__(self, options)
# Use default port, if none specified
if not ":" in destination:
self.destination = (destination, self.port)
else:
self.destination = destination.rsplit(':',1)
# Is destination a v6-address?
try:
socket.inet_pton(socket.AF_INET6, self.destination[0])
self.set_socket(socket.socket(socket.AF_INET6, socket.SOCK_DGRAM))
except:
self.set_socket(socket.socket(socket.AF_INET, socket.SOCK_DGRAM))
for routing_specs in routing_specifications:
self.assign_loadbalancer_to_specs(routing_specs)
评论列表
文章目录