File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
libs/network/example/http Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -224,16 +224,21 @@ int main() {
224224 auto io_service = std::make_shared<boost::asio::io_service>();
225225 echo_server server (
226226 echo_server::options (handler).io_service (io_service).port (" 8000" ));
227- server.run ();
228227
229228 // Clean shutdown when pressing Ctrl+C.
230229 boost::asio::signal_set signals (*io_service, SIGINT, SIGTERM);
231230 signals.async_wait ([&server](const boost::system::error_code& ec,
232231 int /* signal_number */ ) {
233232 if (!ec) {
233+ std::cout << " Stopping server... " ;
234234 server.stop ();
235+ std::cout << " done.\n " ;
235236 }
236237 });
238+
239+ std::cout << " Press Ctrl+C to stop the server.\n " ;
240+ server.run ();
241+
237242 return EXIT_SUCCESS;
238243 } catch (const std::exception& error) {
239244 std::cerr << error.what () << std::endl;
You can’t perform that action at this time.
0 commit comments