diff options
| author | Cory Fields <[email protected]> | 2016-11-10 17:05:23 -0500 |
|---|---|---|
| committer | Cory Fields <[email protected]> | 2016-11-25 12:09:58 -0500 |
| commit | 2ec935dcaab9557addcf73c33aa7f2db8cc01fee (patch) | |
| tree | 3d5d7a29e05f457cee199fd273f24be8fd33550c /src/net.h | |
| parent | net: No need to check individually for disconnection anymore (diff) | |
| download | discoin-2ec935dcaab9557addcf73c33aa7f2db8cc01fee.tar.xz discoin-2ec935dcaab9557addcf73c33aa7f2db8cc01fee.zip | |
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.
Diffstat (limited to 'src/net.h')
| -rw-r--r-- | src/net.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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: |