-
Notifications
You must be signed in to change notification settings - Fork 88
Open
Description
This is more a question than an issue.
I try to make a modbus server in a python thread but I don't know how to stop it.
I took the exact code I found in the example part of documentation.
I set up my app ("get_server(TCPServer, self.interface, RequestHandler)") and I ran this code inside my thread:
try:
app.serve_forever()
finally:
app.shutdown()
app.server_close()
Everything works fine except I have to stop my program manually because my thread never stop.
The question is: how to stop the "app.serve_forever()" part when I don't need my server anymore?
Just in case, I created an event called "stop_event" which can be set whenever I want to.
But I don't really know how to use it to force the server to stop.
Best regards.
Metadata
Metadata
Assignees
Labels
No labels