Websocket re-architecture with websocketd and websocat (#89)

- Replaced beast with websocketd and websocat. #79 #83 #84
- Implemented inbound/outbound peer connection merging.
- Added graceful shutdown of hpcore with sigint. #87
This commit is contained in:
Ravin Perera
2020-04-05 08:12:55 +05:30
committed by GitHub
parent 1904c1800a
commit 920be03ade
60 changed files with 1786 additions and 1753 deletions

View File

@@ -188,7 +188,7 @@ std::string_view getsv(const rapidjson::Value &v)
return std::string_view(v.GetString(), v.GetStringLength());
}
// provide a safe std::string overload for realpath
// Provide a safe std::string overload for realpath
std::string realpath(std::string path)
{
std::array<char, PATH_MAX> buffer;
@@ -197,4 +197,13 @@ std::string realpath(std::string path)
return buffer.data();
}
// Applies signal mask to the calling thread.
void mask_signal()
{
sigset_t mask;
sigemptyset(&mask);
sigaddset(&mask, SIGINT);
pthread_sigmask(SIG_BLOCK, &mask, NULL);
}
} // namespace util