Implemented multi-threaded inbound network message processing. (#115)

Used per-session thread to offload messages from network and a single thread for processing collected messages.
This commit is contained in:
Ravin Perera
2020-09-10 15:40:08 +05:30
committed by GitHub
parent 10cfb6e75f
commit d2f45daf4c
11 changed files with 297 additions and 210 deletions

View File

@@ -137,9 +137,17 @@ void std_terminate() noexcept
int main(int argc, char **argv)
{
//seed rand
// seed rand
srand(util::get_epoch_milliseconds());
// Disable SIGPIPE to avoid crashing on broken pipe IO.
{
sigset_t mask;
sigemptyset(&mask);
sigaddset(&mask, SIGPIPE);
pthread_sigmask(SIG_BLOCK, &mask, NULL);
}
// Register exception handler for std exceptions.
std::set_terminate(&std_terminate);