Reuse buffers to send network data

This commit is contained in:
Patrick Nicolas
2024-04-02 10:45:42 +02:00
parent fff0ba9077
commit 7aa85dfa64
2 changed files with 9 additions and 1 deletions
+2 -1
View File
@@ -196,7 +196,8 @@ public:
template <typename T>
void send(T && data)
{
serialization_packet p;
thread_local serialization_packet p;
p.clear();
uint8_t index = details::Index<std::decay_t<T>, std::tuple<VariantTypes...>>::value;
p.serialize(index);
p.serialize(std::forward<T>(data));