net: add CVectorWriter and CNetMsgMaker
CVectorWriter is useful for overwriting or appending an existing byte vector. CNetMsgMaker is a shortcut for creating messages on-the-fly which are suitable for pushing to CConnman.
This commit is contained in:
parent
b7695c2275
commit
2ec935dcaa
5 changed files with 178 additions and 0 deletions
src
14
src/net.h
14
src/net.h
|
@ -101,6 +101,20 @@ class CTransaction;
|
|||
class CNodeStats;
|
||||
class CClientUIInterface;
|
||||
|
||||
struct CSerializedNetMsg
|
||||
{
|
||||
CSerializedNetMsg() = default;
|
||||
CSerializedNetMsg(CSerializedNetMsg&&) = default;
|
||||
CSerializedNetMsg& operator=(CSerializedNetMsg&&) = default;
|
||||
// No copying, only moves.
|
||||
CSerializedNetMsg(const CSerializedNetMsg& msg) = delete;
|
||||
CSerializedNetMsg& operator=(const CSerializedNetMsg&) = delete;
|
||||
|
||||
std::vector<unsigned char> data;
|
||||
std::string command;
|
||||
};
|
||||
|
||||
|
||||
class CConnman
|
||||
{
|
||||
public:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue