Hi all,
I'm just wondering if there is an easy existing method for cleanly shutting down a websocketpp::server object. In my application, the user is able to turn the server off and on, so I'd like to be able to 'start' and 'stop' the server on demand. I'm looking for a clean way to 'stop' the server.
I know that calling m_server.stop() (where m_server is my server member variable, a websocketpp::server<websocketpp::config::asio> instance) will stop the asio run loop, but even if I call this, there are still open socket connections on my machine. For any existing connected clients, I could probably iterate through a list of them and call m_server.close(conn, ...) to close them, but I don't think that would close the sockets that are listening for incoming connections.
So is there another method I'm missing, or a better way to shut down the server without destroying the object as a whole?