File tree 1 file changed +6
-1
lines changed
libs/network/example/http
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -224,16 +224,21 @@ int main() {
224
224
auto io_service = std::make_shared<boost::asio::io_service>();
225
225
echo_server server (
226
226
echo_server::options (handler).io_service (io_service).port (" 8000" ));
227
- server.run ();
228
227
229
228
// Clean shutdown when pressing Ctrl+C.
230
229
boost::asio::signal_set signals (*io_service, SIGINT, SIGTERM);
231
230
signals.async_wait ([&server](const boost::system ::error_code& ec,
232
231
int /* signal_number */ ) {
233
232
if (!ec) {
233
+ std::cout << " Stopping server... " ;
234
234
server.stop ();
235
+ std::cout << " done.\n " ;
235
236
}
236
237
});
238
+
239
+ std::cout << " Press Ctrl+C to stop the server.\n " ;
240
+ server.run ();
241
+
237
242
return EXIT_SUCCESS;
238
243
} catch (const std::exception & error) {
239
244
std::cerr << error.what () << std::endl;
You can’t perform that action at this time.
0 commit comments