diff options
author | Eric Lombrozo <elombrozo@gmail.com> | 2013-06-05 20:21:41 -0700 |
---|---|---|
committer | Eric Lombrozo <elombrozo@gmail.com> | 2013-06-05 23:15:20 -0700 |
commit | 501da2503a39dd88470df89ccc923c696fe6b111 (patch) | |
tree | 52bb9f3eb186bc99d1a8a96435fd78ac09532235 /src/net.h | |
parent | aabdf9e899e9024927c26c194ad38142495f80bf (diff) |
Using boost::signals2 to message main from net.cpp.
Diffstat (limited to 'src/net.h')
-rw-r--r-- | src/net.h | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -8,6 +8,7 @@ #include <deque> #include <boost/array.hpp> #include <boost/foreach.hpp> +#include <boost/signals2/signal.hpp> #include <openssl/rand.h> #ifndef WIN32 @@ -45,16 +46,15 @@ void StartNode(boost::thread_group& threadGroup); bool StopNode(); void SocketSendData(CNode *pnode); -// -// Handlers that require registration -// -typedef bool (*ProcessMessagesHandler)(CNode* pfrom); -typedef bool (*SendMessagesHandler)(CNode* pto, bool fSendTrickle); -typedef void (*StartShutdownHandler)(); +// Signals for message handling +struct CNodeSignals +{ + boost::signals2::signal<bool (CNode*)> ProcessMessages; + boost::signals2::signal<bool (CNode*, bool)> SendMessages; +}; + +CNodeSignals& GetNodeSignals(); -void SetProcessMessagesHandler(ProcessMessagesHandler handler); -void SetSendMessagesHandler(SendMessagesHandler handler); -void SetStartShutdownHandler(StartShutdownHandler handler); enum { |