I
I
Ilya2015-02-04 09:56:10
Python
Ilya, 2015-02-04 09:56:10

How to kill a thread in python?

I've looked all over the internet and still haven't been able to find an answer on how to end the stream. Everywhere there is information only how to create it.
The essence of the problem:
I am writing a simple program to communicate with the ESP8266 via TCP. After connecting to the server, a stream is created that receives data and sends it to the right place. When the button is pressed, the TCP connection is terminated and the stream must terminate its action. Well, accordingly, by pressing another button, reconnect to the server and start receiving data.
In general, how to kill a thread, and then reuse it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mayorovp, 2015-02-04
@ananevilya

You don't need to kill the thread, you just need to close the socket.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question