def main(): address_queue = Queue() success = False try: with open(FILE_NAME, "r") as file: for line in file: type = line.strip().upper() if type != "" not in server_addresses: # Ignore repeat types # p = Process(target=start_dns_server_process, args=(address_queue,type,)) p = threading.Thread(target=start_dns_server_process, args=(address_queue, type)) p.start() address = address_queue.get() server_addresses[type] = address success = True except IOError: print "Unable to read " + FILE_NAME if success: # Assign the ephemeral port to the server HOST, PORT = ip_address.get(), 9254 server = ThreadedTCPServer((HOST, PORT), ManagerRequestHandler) server_thread = threading.Thread(target=server.serve_forever) server_thread.start() print "DNS Manager Server started with address %s and port %d" % server.server_address print "Ready to serve..." else: print "DNS Manager Server not started"
def main(): address_queue = Queue() success = False try: with open(FILE_NAME, "r") as file: for line in file: type = line.strip().upper() if type != "" not in server_addresses: # Ignore repeat types #p = Process(target=start_dns_server_process, args=(address_queue,type,)) p = threading.Thread(target=start_dns_server_process, args=( address_queue, type, )) p.start() address = address_queue.get() server_addresses[type] = address success = True except IOError: print "Unable to read " + FILE_NAME if success: # Assign the ephemeral port to the server HOST, PORT = ip_address.get(), 9254 server = ThreadedTCPServer((HOST, PORT), ManagerRequestHandler) server_thread = threading.Thread(target=server.serve_forever) server_thread.start() print "DNS Manager Server started with address %s and port %d" % server.server_address print "Ready to serve..." else: print "DNS Manager Server not started"
def start_dns_server(file_name): # Assign the ephemeral port to the server HOST, PORT = ip_address.get(), 0 server = ThreadedTCPServer((HOST, PORT), DNSRequestHandler) server.file_name = file_name server.file_io_lock = threading.RLock() server_thread = threading.Thread(target=server.serve_forever) server_thread.start() return server.server_address
def buttonClicked_info(self): self.lineEdit.setText(ip.get()) self.lineEdit_2.setText(get_lan_ip())