Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method for cleanly quitting the server #12

Closed
zaphoyd opened this issue Sep 15, 2011 · 2 comments
Closed

Method for cleanly quitting the server #12

zaphoyd opened this issue Sep 15, 2011 · 2 comments
Labels

Comments

@zaphoyd
Copy link
Owner

zaphoyd commented Sep 15, 2011

At minimum, catch SIGINT and close all connections/write logs cleanly. Consider how this might work on non-unix systems?

@dark
Copy link

dark commented Aug 18, 2012

Hi, are there any plans for solving this issue?

It would be nice to have a way to stop a server without having to send a signal to the process; i.e., if the websocketpp server is part of a bigger process and runs in its own thread, it would be nice to be able to just stop() the server instance without affecting the other threads.

@zaphoyd
Copy link
Owner Author

zaphoyd commented Nov 5, 2013

endpoint::stop_listening() can be used now to cleanly stop the server from accepting new connections. If you keep a list of all connections you can call close on them individually. Once all connections have been cleanly closed the server run method will exit normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants