mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Using boost::signals2 to message main from net.cpp.
This commit is contained in:
18
src/net.h
18
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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user