diff options
Diffstat (limited to 'src/ReceiverThreads/ReceiverThreads.cpp')
-rw-r--r-- | src/ReceiverThreads/ReceiverThreads.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ReceiverThreads/ReceiverThreads.cpp b/src/ReceiverThreads/ReceiverThreads.cpp index 6f389f2..a99467a 100644 --- a/src/ReceiverThreads/ReceiverThreads.cpp +++ b/src/ReceiverThreads/ReceiverThreads.cpp @@ -27,20 +27,21 @@ ReceiverThreads::ReceiverThreads(const std::string& address, const int timeInter auto ReceiverThreads::receiverThread(const int port) -> void { UDPServer server = UDPServer(address_, port); - std::vector<unsigned short> buf(16000); + std::vector<unsigned short> buf(33000); std::size_t lastIndex{0}; BOOST_LOG_TRIVIAL(info) << "Address: " << address_ << " port: " << port << " timeout: " << timeIntervall_; while(true){ - int bytes = server.timed_recv((char*)buf.data(), buf.size()*sizeof(unsigned short), timeIntervall_); + int bytes = server.timed_recv((char*)buf.data(), 65536, timeIntervall_); if(bytes < 0){ break; } + BOOST_LOG_TRIVIAL(debug) << "Received " << bytes << " Bytes."; std::size_t index = *((std::size_t *)buf.data()); int diff = index - lastIndex - 1; if(diff > 0){ - BOOST_LOG_TRIVIAL(warning) << "Packet loss or wrong order! new: " << index << " old: " << lastIndex; + loss_ += diff; + BOOST_LOG_TRIVIAL(debug) << "Packet loss or wrong order! new: " << index << " old: " << lastIndex; } - loss_ += diff; lastIndex = index; } BOOST_LOG_TRIVIAL(info) << "Lost " << loss_ << " from " << lastIndex << " packets; (" << loss_/(double)lastIndex << "%)"; |