Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
NetEventsInterface Class Referenceabstract

Interface for message handling. More...

#include <net.h>

Inheritance diagram for NetEventsInterface:
[legend]
Collaboration diagram for NetEventsInterface:
[legend]

Public Member Functions

virtual void InitializeNode (const Config &config, CNode &node, ServiceFlags our_services)=0
 Initialize a peer (setup state, queue any initial messages)
 
virtual void FinalizeNode (const Config &config, const CNode &node)=0
 Handle removal of a peer (clear state)
 
virtual bool ProcessMessages (const Config &config, CNode *pnode, std::atomic< bool > &interrupt) EXCLUSIVE_LOCKS_REQUIRED(g_msgproc_mutex)=0
 Process protocol messages received from a given node.
 
virtual bool SendMessages (const Config &config, CNode *pnode) EXCLUSIVE_LOCKS_REQUIRED(g_msgproc_mutex)=0
 Send queued protocol messages to a given node.
 

Static Public Attributes

static Mutex g_msgproc_mutex
 Mutex for anything that is only accessed via the msg processing thread.
 

Protected Member Functions

 ~NetEventsInterface ()=default
 Protected destructor so that instances can only be deleted by derived classes.
 

Detailed Description

Interface for message handling.

Definition at line 792 of file net.h.

Constructor & Destructor Documentation

◆ ~NetEventsInterface()

NetEventsInterface::~NetEventsInterface ( )
protecteddefault

Protected destructor so that instances can only be deleted by derived classes.

If that restriction is no longer desired, this should be made public and virtual.

Member Function Documentation

◆ FinalizeNode()

virtual void NetEventsInterface::FinalizeNode ( const Config config,
const CNode node 
)
pure virtual

Handle removal of a peer (clear state)

◆ InitializeNode()

virtual void NetEventsInterface::InitializeNode ( const Config config,
CNode node,
ServiceFlags  our_services 
)
pure virtual

Initialize a peer (setup state, queue any initial messages)

◆ ProcessMessages()

virtual bool NetEventsInterface::ProcessMessages ( const Config config,
CNode pnode,
std::atomic< bool > &  interrupt 
)
pure virtual

Process protocol messages received from a given node.

Parameters
[in]configThe applicable configuration object.
[in]pnodeThe node which we have received messages from.
[in]interruptInterrupt condition for processing threads
Returns
True if there is more work to be done

◆ SendMessages()

virtual bool NetEventsInterface::SendMessages ( const Config config,
CNode pnode 
)
pure virtual

Send queued protocol messages to a given node.

Parameters
[in]configThe applicable configuration object.
[in]pnodeThe node which we are sending messages to.
Returns
True if there is more work to be done

Member Data Documentation

◆ g_msgproc_mutex

Mutex NetEventsInterface::g_msgproc_mutex
static

Mutex for anything that is only accessed via the msg processing thread.

Definition at line 797 of file net.h.


The documentation for this class was generated from the following files: