diff options
author | Pieter Wuille <pieter@wuille.net> | 2023-07-21 16:31:59 -0400 |
---|---|---|
committer | Pieter Wuille <pieter@wuille.net> | 2023-08-23 19:56:24 -0400 |
commit | 0de48fe858a1ffcced340eef2c849165216141c8 (patch) | |
tree | 71f5f482da77208beb51b7c6dc4c6ca721420d94 /src/test/util/net.h | |
parent | 649a83c7f73db2ee115f5dce3df16622e318aeba (diff) |
net: abstract sending side of transport serialization further
This makes the sending side of P2P transports mirror the receiver side: caller provides
message (consisting of type and payload) to be sent, and then asks what bytes must be
sent. Once the message has been fully sent, a new message can be provided.
This removes the assumption that P2P serialization of messages follows a strict structure
of header (a function of type and payload), followed by (unmodified) payload, and instead
lets transports decide the structure themselves.
It also removes the assumption that a message must always be sent at once, or that no
bytes are even sent on the wire when there is no message. This opens the door for
supporting traffic shaping mechanisms in the future.
Diffstat (limited to 'src/test/util/net.h')
-rw-r--r-- | src/test/util/net.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/util/net.h b/src/test/util/net.h index b2f6ebb163..687ce1e813 100644 --- a/src/test/util/net.h +++ b/src/test/util/net.h @@ -54,7 +54,7 @@ struct ConnmanTestMsg : public CConnman { void NodeReceiveMsgBytes(CNode& node, Span<const uint8_t> msg_bytes, bool& complete) const; - bool ReceiveMsgFrom(CNode& node, CSerializedNetMsg& ser_msg) const; + bool ReceiveMsgFrom(CNode& node, CSerializedNetMsg&& ser_msg) const; }; constexpr ServiceFlags ALL_SERVICE_FLAGS[]{ |