3#include "imr/mold/types.h"
14
15
16
17
18
19
20
21
22
34 std::size_t
MTU{1472};
36
37
38
39
40
41
42
43
48
49
50
53
54
55
57 bool try_add(std::span<
const char> message)
noexcept;
69 std::string_view
session()
const noexcept;
73 std::size_t bytes_remaining_;
78 std::vector<iovec> iovecs_;
80 std::size_t min_message_size_;
Builds MoldUDP64 packets.
Definition packet_builder.h:24
PacketBuilder(const Config &cfg)
void reset(types::header::SequenceNumber seq=1) noexcept
Writes sequence number for new packet to header and clears the message block.
std::span< iovec > finalize() noexcept
Writes the message count to the header and returns header + message block as iovecs.
static constexpr auto min_message_size
Definition packet_builder.h:27
bool try_add(std::span< const char > message) noexcept
Adds a message to the messge block.
types::header::MessageCount message_count() const noexcept
Number of messages added since last reset().
std::string_view session() const noexcept
Returns the configured MoldUDP64 session from header.
Definition packet_builder.h:30
std::string_view session
MoldUDP64 Session, Must be 10 characters.
Definition packet_builder.h:32
std::size_t min_message_size
Smallest possible message size (including 2-byte length prefix); defaults to 14 (TotalView-ITCH 5....
Definition packet_builder.h:44
std::size_t MTU
MTU for packet, default is ethernet MTU (1500 bytes) - IP/UDP headers (28 bytes).
Definition packet_builder.h:34