Skip sendmmsg if there is nothing to send
This commit is contained in:
@@ -421,6 +421,10 @@ void wivrn::UDP::send_many_raw(std::span<serialization_packet> packets)
|
|||||||
thread_local std::vector<iovec> iovecs;
|
thread_local std::vector<iovec> iovecs;
|
||||||
thread_local std::vector<mmsghdr> mmsgs;
|
thread_local std::vector<mmsghdr> mmsgs;
|
||||||
thread_local std::vector<uint64_t> iv_counters;
|
thread_local std::vector<uint64_t> iv_counters;
|
||||||
|
|
||||||
|
if (packets.empty())
|
||||||
|
return;
|
||||||
|
|
||||||
iovecs.clear();
|
iovecs.clear();
|
||||||
mmsgs.clear();
|
mmsgs.clear();
|
||||||
iv_counters.clear();
|
iv_counters.clear();
|
||||||
@@ -610,6 +614,10 @@ void wivrn::TCP::send_many_raw(std::span<serialization_packet> packets)
|
|||||||
thread_local std::vector<iovec> iovecs;
|
thread_local std::vector<iovec> iovecs;
|
||||||
thread_local std::vector<uint16_t> sizes;
|
thread_local std::vector<uint16_t> sizes;
|
||||||
thread_local std::vector<std::span<uint8_t>> spans;
|
thread_local std::vector<std::span<uint8_t>> spans;
|
||||||
|
|
||||||
|
if (packets.empty())
|
||||||
|
return;
|
||||||
|
|
||||||
iovecs.clear();
|
iovecs.clear();
|
||||||
sizes.clear();
|
sizes.clear();
|
||||||
spans.clear();
|
spans.clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user