aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorEric Lombrozo <elombrozo@gmail.com>2013-06-05 20:21:41 -0700
committerEric Lombrozo <elombrozo@gmail.com>2013-06-05 23:15:20 -0700
commit501da2503a39dd88470df89ccc923c696fe6b111 (patch)
tree52bb9f3eb186bc99d1a8a96435fd78ac09532235 /src/net.h
parentaabdf9e899e9024927c26c194ad38142495f80bf (diff)
Using boost::signals2 to message main from net.cpp.
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/net.h b/src/net.h
index 1c8c99aa3b..fdac60d9ce 100644
--- a/src/net.h
+++ b/src/net.h
@@ -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
{