Here I am creating 3 threads for one server and 2 clients. I wanted to stop the thread and make the port numbers reusable after one execution. My code is
t1=threading.Thread(target=serv)
t2=threading.Thread(target=cli1)
t3=threading.Thread(target=cli2)
t1.start()
time.sleep(2)
t2.start()
time.sleep(2)
t1.start()
time.sleep(2)
Here serv
, cli1
and cli2
are the functions that contains client server programs.
How do I terminate these threads ?