MCPcopy Create free account
hub / github.com/Haivision/srt / addMessage

Method addMessage

test/test_buffer_rcv.cpp:83–95  ·  view source on GitHub ↗

@returns 0 on success, the result of rcv_buffer::insert(..) once it failed

Source from the content-addressed store, hash-verified

81
82 /// @returns 0 on success, the result of rcv_buffer::insert(..) once it failed
83 int addMessage(size_t msg_len_pkts, int msgno, int start_seqno, bool out_of_order = false, int ts = 0)
84 {
85 for (size_t i = 0; i < msg_len_pkts; ++i)
86 {
87 const bool pb_first = (i == 0);
88 const bool pb_last = (i == (msg_len_pkts - 1));
89 const int res = addPacket(start_seqno + int(i), msgno, pb_first, pb_last, out_of_order, ts);
90
91 if (res != 0)
92 return res;
93 }
94 return 0;
95 }
96
97 void generatePayload(char* dst, size_t len, int seqno) { std::iota(dst, dst + len, (char)seqno); }
98

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected