Skip to content

Commit

Permalink
Merge pull request stingergraph#193 from ehein6/server-sleep
Browse files Browse the repository at this point in the history
Servers should sleep instead of waiting for input.
  • Loading branch information
davidediger authored Sep 26, 2016
2 parents c01c3be + 2cd2164 commit dac7145
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/clients/tools/json_rpc_server/src/json_rpc_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ main (int argc, char ** argv)
if(unleash_daemon) {
while(1) { sleep(10); }
} else {
printf("Press <q> to shut down the server...\n");
while (getchar() != 'q');
printf("Press Ctrl-C to shut down the server...\n");
while(1) { sleep(10); }
}

return 0;
Expand Down
6 changes: 2 additions & 4 deletions src/server/src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,10 @@ int main(int argc, char *argv[])
close (start_pipe[1]);
while(1) { sleep(10); }
} else {
LOG_I("Press <q> to shut down the server...");
while (getchar() != 'q');
LOG_I("Press Ctrl-C to shut down the server...");
while(1) { sleep(10); }
}

cleanup ();

return 0;
}

Expand Down

0 comments on commit dac7145

Please sign in to comment.