Nov-27-2019, 04:13 PM
I solved my own problem.
I needed to make the chat_history_listbox as a ListBox initially, instead of None
I needed to put the receive code into a function, with a loop and an exit condition
I needed to make the chat_history_listbox as a ListBox initially, instead of None
I needed to put the receive code into a function, with a loop and an exit condition
def receive_func(): global server, chat_history_listbox while True: try: update = server.recv(1024) except OSError as e: update = None break connect() msg = update.decode("utf-8") if msg != "": chat_history_listbox.insert(END, msg)I needed to make the thread call a function and make it a daemon
listener = Thread(target=receive_func, daemon=True) listener.start()This got it working with multiple clients