How to stop/kill Synchronous "StartTcpServer" #1102
-
I'm running a Modbus TCP server in a python program to serve values coming from another python app (running on the same machine). The Modbus TCP server is running in it's own thread and the other python app is running in another thread (both launch from the same main.py thread). Occasionally, I need to stop the program for maintenance/edits, but when I stop the program, the Modbus TCP server thread doesn't stop and I have rogue Modbus TCP server programs running on my machine and using up the 502 port. I have to restart the machine to get the program to actually stop. Question: Since "StartTcpServer" is a blocking call, how can I stop this server whenever I need to stop the program? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
see test/ test_examples.py |
Beta Was this translation helpful? Give feedback.
see test/ test_examples.py