Threading and Socket help in python
The threading never finishes its full loop and stops after each thread. I default at 10 threads and it stops after 10 attempts. Can someone help fix this issue? #Put domains into a list def listdomains(thread): global list_of_lists a_file = open("tools/temp", "r") list_of_lists = [(line.strip()).split() for line in a_file] a_file.close() threading_pool(int(thread)) #Check if DNS server def dns_test(domain): try: ip = socket.gethostbyname(domain[0]) print(ip) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) result = sock.connect_ex((ip,53)) if result == 0: print("test") else: print("not open") except: print("errored") pass sock.close() #Threading def threading_pool(thread): try: pool = Pool(thread) for domain in list_of_lists: pool.apply_async(dns_test, (domain,)) pool.close() pool.join() except KeyboardInterrupt: print("\n Interrupt") exit()