diff options
author | Determinant <[email protected]> | 2019-10-13 14:05:29 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2019-10-13 14:05:29 -0400 |
commit | 3505e9d33eab6d341185773c1da315b2dc833a21 (patch) | |
tree | a67629fea47ee83f5c05d781198469f135882eeb /test/test_p2p.cpp | |
parent | 8270af53b2e4741fcacab49a21823597cc31d88c (diff) |
WIP: bounded recv buffer
Diffstat (limited to 'test/test_p2p.cpp')
-rw-r--r-- | test/test_p2p.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_p2p.cpp b/test/test_p2p.cpp index d097562..aff712a 100644 --- a/test/test_p2p.cpp +++ b/test/test_p2p.cpp @@ -28,6 +28,7 @@ #include <functional> #include <unordered_map> #include <unistd.h> +#include <signal.h> #include "salticidae/msg.h" #include "salticidae/event.h" @@ -67,6 +68,13 @@ struct MsgText { const uint8_t MsgText::opcode; +void masksigs() { + sigset_t mask; + sigemptyset(&mask); + sigfillset(&mask); + pthread_sigmask(SIG_BLOCK, &mask, NULL); +} + struct Net { uint64_t id; EventContext ec; @@ -98,6 +106,7 @@ struct Net { this->id, std::string(claimed_addr).c_str()); }); th = std::thread([=](){ + masksigs(); try { net->start(); net->listen(NetAddr(listen_addr)); |