Oct-13-2018, 09:04 PM
Hi folks.
I have an app which is part system reporting tool and part socket server. I've written this as one app as both bits are dependent.
So the app starts and creates two threads, reporter and server, both started and joined as both are no ending.
The problem I have is in the server thread, the very simple socket code creates a new thread for a client connection, perfumes a task and ends. However my line;
thread.start_new_thread(handler, (client socket, clientaddr))
throws an error saying start_new_thread doesn't exist.
It most certainly does! And until I changed this code recently to run in a thread it was working fine. So, is there any reason why I can't start a thread from a running thread that isn't main?
Thanks.
I have an app which is part system reporting tool and part socket server. I've written this as one app as both bits are dependent.
So the app starts and creates two threads, reporter and server, both started and joined as both are no ending.
The problem I have is in the server thread, the very simple socket code creates a new thread for a client connection, perfumes a task and ends. However my line;
thread.start_new_thread(handler, (client socket, clientaddr))
throws an error saying start_new_thread doesn't exist.
It most certainly does! And until I changed this code recently to run in a thread it was working fine. So, is there any reason why I can't start a thread from a running thread that isn't main?
Thanks.