Skip to content

Commit

Permalink
server : stop gracefully on SIGTERM (#6348)
Browse files Browse the repository at this point in the history
  • Loading branch information
EZForever committed Mar 28, 2024
1 parent d2d8f38 commit 6902cb7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions examples/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3566,6 +3566,7 @@ int main(int argc, char ** argv) {
sigemptyset (&sigint_action.sa_mask);
sigint_action.sa_flags = 0;
sigaction(SIGINT, &sigint_action, NULL);
sigaction(SIGTERM, &sigint_action, NULL);
#elif defined (_WIN32)
auto console_ctrl_handler = +[](DWORD ctrl_type) -> BOOL {
return (ctrl_type == CTRL_C_EVENT) ? (signal_handler(SIGINT), true) : false;
Expand Down

0 comments on commit 6902cb7

Please sign in to comment.