Closed leovailati closed 7 years ago
server.run()
is equivalent to loop { server.poll() }
, so if you want to stop the server at some point you can just change your code to call server.poll()
repeatedly in a loop until some condition becomes true.
Thank you for your answer. Quick follow-up question: is there a way to exit the handler without responding to a request?
Unfortunately that's not possible.
I see, thank you very much!
Hello,
What is the appropriate way to stop the server?
According to documentation for
Server::run()
:And
start_server
never returns (!
).